Erik Schnetter <[EMAIL PROTECTED]> writes:

> On Nov 22, 2005, at 04:33:12, Tommy Pettersson wrote:
[...]
> > It's true that darcs doesn't modify the contents of the
> > patch files in _darcs/patches/, but it certainly sometimes
> > removes them and recreates them under the very same names but
> > with slightly different contents.
> 
> Interesting.  Thanks for the clarification.  Since patches are
> immutable, and since the file names contain time stamps and an MD5
> (?) code, I assumed that they would not change.
> Are you saying I
> could push a patch to a different repository, and although the
> "meaning" of the patch stays the same, and its time stamp and
> checksum doesn't change, the content of the file still can change?

Patches are immutable (if you don't use unsafe commands like
amend-record), but the representation of the patch can change
because it depends on the context. The filename contains only
a hash of date, name, author and log but not of the content.

Here is a simple example with repos 1 and 2:
1 % darcs init
1 % echo "foo" > a
1 % darcs rec -l -a -m "commit 1"
1 % darcs put ../2

2 % darcs mv a b
2 % darcs rec -a -m "file move"

1 % echo "bar" > a
1 % darcs rec -a -m "change file"

1 % darcs push -a ../2
1 % darcs pull -a ../2
# both repos contains "commit 1", "file move" and "change file", but
# in different order.

1 % zcat ../2/_darcs/patches/20051122211228-50d88-fcae0c63bc0a848dfa7ca.gz
[change file
author <[EMAIL PROTECTED]>**20051122211228] {
hunk ./b 1
-foo
+bar
}
1 % zcat ../1/_darcs/patches/20051122211228-50d88-fcae0c63bc0a848dfa7ca.gz
[change file
author <[EMAIL PROTECTED]>**20051122211228] {
hunk ./a 1
-foo
+bar
}
# the representation of "change file" is different in the two repos.

I thought --optimize-reorder would work together with the sibling
flag, but that doesn't seem to be the case. So creating an example
where optimize changes the representation of a patch in a single
repo is more complicated.

Benedikt


_______________________________________________
darcs-users mailing list
[email protected]
http://www.abridgegame.org/mailman/listinfo/darcs-users

Reply via email to