Eric,
This should fix (1), (2) and (3) in your other email. I double checked the
logic of checking for the summary flag in smart_diff and realized that
unless someone figures out a way to do something like,
'darcs record --summary' then 'NoSummary' in Record.lhs is redundant.
These changes are not as well tested as the previous incarnation. These
changes do, of course, pass the test suite but have not been rigorously
tested by using them day to day. On the other hand, the only real difference
from the previous version is that 'NoSummary' is no longer passed redundantly.
Thanks,
Jason
Sun Sep 10 12:38:03 PDT 2006 Jason Dagit <[EMAIL PROTECTED]>
* whatsnew --look-for-adds doesn't read unadded files (fix for issue79)
The default mode for whatsnew --look-for-adds is summary mode. In summary
mode full patches are not needed. This fix changes whatsnew
--look-for-adds to stop computing the full patch for a file when the
file is not managed by darcs.
New patches:
[whatsnew --look-for-adds doesn't read unadded files (fix for issue79)
Jason Dagit <[EMAIL PROTECTED]>**20060910193803
The default mode for whatsnew --look-for-adds is summary mode. In summary
mode full patches are not needed. This fix changes whatsnew
--look-for-adds to stop computing the full patch for a file when the
file is not managed by darcs.
] {
hunk ./Diff.lhs 45
-import DarcsFlags ( DarcsFlag(IgnoreTimes,LookForAdds) )
+import DarcsFlags ( DarcsFlag(IgnoreTimes,LookForAdds,Summary,NoSummary) )
hunk ./Diff.lhs 59
- = case gendiff (ignore_times, look_for_adds) wt [] s1 s2 [] of
+ = case gendiff (ignore_times, look_for_adds, summary) wt [] s1 s2 [] of
hunk ./Diff.lhs 64
+ -- NoSummary/Summary both present gives False
+ -- Just Summary gives True
+ -- Just NoSummary gives False
+ -- Neither gives False
+ summary = Summary `elem` opts && NoSummary `notElem` opts
hunk ./Diff.lhs 73
-gendiff :: (Bool,Bool)
+gendiff :: (Bool,Bool,Bool)
hunk ./Diff.lhs 76
-gendiff opts@(isparanoid,_) wt fps s1 s2
+gendiff opts@(isparanoid,_,_) wt fps s1 s2
hunk ./Diff.lhs 102
-recur_diff :: (Bool,Bool)
+-- recur_diff or recursive diff
+-- First parameter is (IgnoreTimes?, LookforAdds?, Summary?)
+recur_diff :: (Bool,Bool,Bool)
hunk ./Diff.lhs 108
-recur_diff opts@(_,doadd) wt fps (s:ss) (s':ss')
+recur_diff opts@(_,doadd,summary) wt fps (s:ss) (s':ss')
+ -- this is the case if a file has been removed in the working directory
hunk ./Diff.lhs 111
+ -- this next case is when there is a file in the directory that is not
+ -- in the repository (ie, not managed by darcs)
hunk ./Diff.lhs 115
- else diff_added wt fps s' . rest
+ else diff_added summary wt fps s' . rest
+ -- actually compare the files because the names match
hunk ./Diff.lhs 120
-recur_diff opts@(_,True) wt fps [] (s':ss') =
- diff_added wt fps s' . recur_diff opts wt fps [] ss'
-recur_diff (_,False) _ _ [] _ = id
+recur_diff opts@(_,True,summary) wt fps [] (s':ss') =
+ diff_added summary wt fps s' . recur_diff opts wt fps [] ss'
+recur_diff (_,False,_) _ _ [] _ = id
hunk ./Diff.lhs 125
+-- creates a diff for a file or directory which needs to be added to the
+-- repository
+diff_added :: Bool -> (FilePath -> FileType) -> [FilePath] -> Slurpy
+ -> ([Patch] -> [Patch])
+diff_added summary wt fps s
+ | is_file s = case wt n of
+ TextFile -> (addfile f:) . (if summary then id else
+ diff_from_empty id f (get_filecontents s))
+ BinaryFile -> (addfile f:) . (if summary then id else
+ (bin_patch f
+ nilPS (getbin $ get_filecontents s)))
+ | otherwise {- is_dir s -} =
+ (adddir f:)
+ . foldr (.) id (map (diff_added summary wt (n:fps)) (get_dircontents s))
+ where n = slurp_name s
+ f = mk_filepath (n:fps)
+
hunk ./Diff.lhs 191
-
-diff_added :: (FilePath -> FileType) -> [FilePath] -> Slurpy
- -> ([Patch] -> [Patch])
-diff_added wt fps s
- | is_file s = case wt n of
- TextFile -> (addfile f:)
- . diff_from_empty id f (get_filecontents s)
- BinaryFile -> (addfile f:)
- . (bin_patch f
- nilPS (getbin $ get_filecontents s))
- | otherwise {- is_dir s -} =
- (adddir f:)
- . foldr (.) id (map (diff_added wt (n:fps)) (get_dircontents s))
- where n = slurp_name s
- f = mk_filepath (n:fps)
hunk ./WhatsNew.lhs 97
-whatsnew_cmd opts args | LookForAdds `elem` opts && NoSummary `notElem` opts = do
+whatsnew_cmd opts' args
+ | LookForAdds `elem` opts' && NoSummary `notElem` opts' = do
+ -- add Summary to the opts since 'darcs whatsnew --look-for-adds'
+ -- implies summary
+ let opts = Summary : opts'
hunk ./WhatsNew.lhs 122
- smart_diff [LookForAdds] ftf so sn
+ smart_diff [LookForAdds,Summary] ftf so sn
}
Context:
[overhaul the darcs.net front page.
Mark Stosberg <[EMAIL PROTECTED]>**20060820191415
The themes to this change are:
- Focus on the key benefits of darcs:
Distributed. Interactive. Smart.
- Recognize that the wiki is the central resource,
and remove some information that is duplicated here
and reference the wik instead.
I can post a demo of this HTML for easy comparison if you'd like.
Mark
]
[Reimplement --disable-ssh-cm flag (issue239).
Eric Kow <[EMAIL PROTECTED]>**20060812134856
My patch to "Only launch SSH control master on demand" accidentally
removed the ability to disable use of SSH ControlMaster. Also, the
way it was implemented is not compatible with launching on demand.
This implementation relies on a notion of global variables using
unsafe IORefs.
]
[Compile Global.lhs in place of AtExit.lhs.
Eric Kow <[EMAIL PROTECTED]>**20060812121943]
[Rename AtExit module to Global.
Eric Kow <[EMAIL PROTECTED]>**20060812121925
The goal is to capture some broad "global" notions like exit handlers
and global variables. Note the GPL header thrown in for good measure.
]
[Raise exception if unable to open logfile (issue142).
Zachary P. Landau <[EMAIL PROTECTED]>**20060810034035]
[Make the pull 'permission test' work when run as root
Jon Olsson <[EMAIL PROTECTED]>**20060831193834]
[TAG darcs-unstable-20060831
Juliusz Chroboczek <[EMAIL PROTECTED]>**20060831191554]
Patch bundle hash:
7ca4e8f70121c93d6b5d5c292ab186dd60821d1a
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel