[darcs-devel] darcs patch: Make annotate work on files with spaces in the name

Eric Y. Kow eric.kow at gmail.com
Mon Dec 25 09:02:29 PST 2006


On Wed, Dec 20, 2006 at 14:32:33 +0100, Juliusz Chroboczek wrote:
> > (I don't really know what a Population is, so I'll need some time to
> > poke around and learn)
> 
> When you find out, please summarise for the list.

Ok, here goes.

A Population, much like a Slurpy is a representation of a directory
tree.  Populations contain far less information than slurpies. Each
file/directory name is associated with metadata, what patch they
were last modified by (PatchInfo), who created the file, etc.

It seems that Populations are used for informational "read-only"
purposes only.  There is code in the core Patch routines
(PatchApply.applyToPop) which applies patches to a population, but such
code only exists to update the metadata in the tree.  For example, hunk
patches are ignored.

Annotate uses the code to find out who created the file in question.
That is, given a filename, we lookup the name from the Population and
print out the associated metadata.  This doesn't give us the full
annotation, of course -- we'd have to manipulate the actual patches for
that -- but it gives us easy access to the initial information. (*)
Also, when annotating a directory tree, Population has a second use.
We can directly extract information such as "Mary removed file foo in
this directory" by traversing the PopTree and reading the metadata.

Some of the Population code looks like it is presently unused.
Population.popUnfold is one such example.  Do we have a future use for
these? Are they cruft from the past?

(*) I wonder why we do it this way.  One would think that, since we are
running the patches backwards anyway, we can get the information from
there.  Maybe it's something to do with partial repositories?  Maybe
it's just so much more convenient that way?

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20061225/b6ecefa8/attachment.pgp


More information about the darcs-devel mailing list