Hi Juliusz,

Here's a patch to add the comment you requested on
with_partial_intersection.  It actually took me a while to figure out what
exactly it does, which is a good sign that the code needed a bit more
documentation...

David

Sun Dec 18 07:20:29 EST 2005  David Roundy <[EMAIL PROTECTED]>
  * reorganize comments (and add a comment) in Depends.lhs.

New patches:

[reorganize comments (and add a comment) in Depends.lhs.
David Roundy <[EMAIL PROTECTED]>**20051218122029] 
<
> {
hunk ./Depends.lhs 59
 get_common_and_uncommon_err (ps1,ps2) = gcau (optimize_patchset ps1) ps2
 
 {-
-gcau determines a list of "common" patches and patches unique to each of
-the two PatchSets.  The list of "common" patches only needs to include all
-patches that are not interspersed with the "unique" patches, but including
-more patches in the list of "common" patches doesn't really hurt, except
-for efficiency considerations.  Mostly, we want to access as few elements
-as possible of the PatchSet list, since those can be expensive (or
-unavailable).
+with_partial_intersection takes two PatchSets and splits them into a common
+intersection portion and two sets of patches.  The intersection, however,
+is only lazily determined, so there is no guarantee that all intersecting
+patches will be included in the intersection PatchSet.  This is a pretty
+efficient function, because it makes use of the already-broken-up nature of
+PatchSets.
 
hunk ./Depends.lhs 66
-PatchSets have the property that if
-
-(fst $ last $ head a) == (fst $ last $ head b)
-
-then (tail a) and (tail b) are identical repositories, and we want to take
-advantage of this if possible, to avoid reading too many inventories.  In
-the case of --partial repositories or patch bundles, it is crucial that we
-don't need to read the whole history, since it isn't available.
-
-TODO:
-
-The length equalising isn't necessarily right. We probably also be
-thinking about not going past the end of a partial repo, or favour
-local repo stuff over remote repo stuff.
-
-Also, when comparing l1 to l2, we should really be comparing the
-newly discovered one to /all/ the lasts in the other patch set
-that we've got so far.
+with_partial_intersection is sort of a weak version of gcau below that only
+takes advantage of the low-hanging fruit.  Ideally, I'd like to see gcau
+rewritten to use with_partial_intersection, so we'd have all this sort of
+code in one place, since this code really should be much better written to
+work with partial repositories.
 -}
 
 with_partial_intersection :: PatchSet -> PatchSet
hunk ./Depends.lhs 122
                          [] -> j [[]] (cr ps1) (cr ps2)
           cr = concat . reverse
 
+{-
+gcau determines a list of "common" patches and patches unique to each of
+the two PatchSets.  The list of "common" patches only needs to include all
+patches that are not interspersed with the "unique" patches, but including
+more patches in the list of "common" patches doesn't really hurt, except
+for efficiency considerations.  Mostly, we want to access as few elements
+as possible of the PatchSet list, since those can be expensive (or
+unavailable).
+
+PatchSets have the property that if
+
+(fst $ last $ head a) == (fst $ last $ head b)
+
+then (tail a) and (tail b) are identical repositories, and we want to take
+advantage of this if possible, to avoid reading too many inventories.  In
+the case of --partial repositories or patch bundles, it is crucial that we
+don't need to read the whole history, since it isn't available.
+
+TODO:
+
+The length equalising isn't necessarily right. We probably also be
+thinking about not going past the end of a partial repo, or favour
+local repo stuff over remote repo stuff.
+
+Also, when comparing l1 to l2, we should really be comparing the
+newly discovered one to /all/ the lasts in the other patch set
+that we've got so far.
+-}
+
 
 gcau :: PatchSet -> PatchSet
      -> Either MissingPatch ([PatchInfo],PatchSet,PatchSet)
}

Context:

[RemoteApply no longer depends on cd, use --repodir instead.
[EMAIL PROTECTED]
 
 This is a minor change to make darcs no longer use cd
 before applying patches to a remote repository. 
 Now the --repodir option for the apply command is used.
 
 This patch came from a hack to rssh[http://sf.net/projects/rssh]
 to allow using darcs as a restricted command without depending
 on the cd binary.
 http://sf.net/tracker/index.php?func=detail&aid=1351939&group_id=65349&atid=510643
] 
[Support signed push
Esa Ilari Vuokko <[EMAIL PROTECTED]>**20051129082159] 
[Fix typo in multirepo pull.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20051217201918] 
[Fix merge conflicts.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20051217201903] 
[Use POSIX-style option for 'head', instead of obsolescent syntax
Marnix Klooster <[EMAIL PROTECTED]>**20051216111731] 
[Clarify wording for changes that can't be unreverted
[EMAIL PROTECTED] 
[Set attachment filename when sending a patch bundle by e-mail.
Zachary P. Landau <[EMAIL PROTECTED]>**20051217195009] 
[save long comment file if a test fails during record
Zachary P. Landau <[EMAIL PROTECTED]>**20051216023948] 
[properly quote paths so that paths with spaces in them are okay
[EMAIL PROTECTED] 
[fix up debug printouts in cygwin-wrapper.bash
[EMAIL PROTECTED] 
[smoother invocation of cygwin-wrapper.bash -- it detects fully-qualified path to itself by leading /
[EMAIL PROTECTED] 
[modernize amend-record.pl to be more portable.
Mark Stosberg <[EMAIL PROTECTED]>**20050402133417
 
 This depends on the new "echo_to_darcs()" function in Test::Darcs
] 
[add changelog entry for multirepo pull.
David Roundy <[EMAIL PROTECTED]>**20051215122808] 
[implementation of --set-scripts-executable on local darcs get
[EMAIL PROTECTED]
 proposed fix for issue38
 
 The --set-scripts-executable flag is normally evaluated when you apply
 patches.  But when you do a local darcs get, no patches are applied.
 So as a solution, we traverse the directory on local darcs get , and set
 any script files to be executable. 
 
 Note: one flaw in this patch is that it duplicates the definition of
 what a script is -- a file that starts with #! -- in PatchApply.lhs and
 Get.lhs.  It might be good to refactor these somehow.
 
] 
[extended set-scripts-executable test
[EMAIL PROTECTED]
 added check for local darcs get (issue 38) as well as initial sanity check
  
] 
[Fix merge conflicts.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20051214223217] 
[Add --subject flag to 'darcs send'
Joeri van Ruth <[EMAIL PROTECTED]>**20051205120301] 
[print out the patch name when a test fails.
Zachary P. Landau <[EMAIL PROTECTED]>**20051205055109] 
[Fix mistyped /dev/null, fixes --sendmail-command in Windows
Esa Ilari Vuokko <[EMAIL PROTECTED]>**20051129160120] 
[Use \ as path separator for GnuPG in Windows -- makes apply --verify work
Esa Ilari Vuokko <[EMAIL PROTECTED]>**20051129164533] 
[make dangers and recommended use of "Amend" clearer in the docs.
Mark Stosberg <[EMAIL PROTECTED]>**20051213140523
 
 I think it's important to be clearer about when it's appropriate to use 'amend',
 so I moved some notes into the short and mid-length help texts.
] 
[update web page to reflect 1.0.5 as latest stable source.
Tommy Pettersson <[EMAIL PROTECTED]>**20051213111137] 
[fix handling of absolute paths containing drive letters
Will <[EMAIL PROTECTED]>**20051208054737
 This fixes issue 47 where paths containing drive letters (i.e. on windows)
 are not treated as absolute paths.
] 
[bump version to 1.0.6pre1
Tommy Pettersson <[EMAIL PROTECTED]>**20051208092839] 
[revert maybe_relink and atomic_create to original C code.
David Roundy <[EMAIL PROTECTED]>**20051208131213] 
[resolve conflicts between stable and unstable.
David Roundy <[EMAIL PROTECTED]>**20051206134818] 
[Merge changes
Ian Lynagh <[EMAIL PROTECTED]>**20051008225210] 
[add support for pulling from multiple repositories simultaneously.
David Roundy <[EMAIL PROTECTED]>**20050919125012] 
[fix mkstemp implementation for win32
Peter Strand <[EMAIL PROTECTED]>**20050810211303] 
[Implement parts of System.Posix.(IO|Files) for win32
[EMAIL PROTECTED] 
[implement RawMode with library functions instead of ffi
[EMAIL PROTECTED] 
[call hsc2hs without output filename argument
[EMAIL PROTECTED] 
[Rename compat.c to c_compat.c to avoid object filename conflict with Compat.hs
[EMAIL PROTECTED] 
[Move atomic_create/sloppy_atomic_create to Compat
Ian Lynagh <[EMAIL PROTECTED]>**20050730141703] 
[Split the raw mode stuff out into its own .hsc file. Windows needs some TLC
Ian Lynagh <[EMAIL PROTECTED]>**20050730134030] 
[Move maybe_relink out of compat.c
Ian Lynagh <[EMAIL PROTECTED]>**20050730131205] 
[Remove is_symlink
Ian Lynagh <[EMAIL PROTECTED]>**20050730122255] 
[Move mkstemp to Compat.hs
Ian Lynagh <[EMAIL PROTECTED]>**20050730020918] 
[Start Compat.hs, and move stdout_is_a_pipe from compat.c
Ian Lynagh <[EMAIL PROTECTED]>**20050730004829] 
[TAG 1.0.5
Tommy Pettersson <[EMAIL PROTECTED]>**20051207112730] 
Patch bundle hash:
e07d43845e4d484fb9453676fafab7f16e9fcdab
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel

Reply via email to