view tests/test-log.out @ 5192:33015dac5df5

convert: fix mercurial_sink.putcommit Changeset 4ebc8693ce72 added some code to putcommit to avoid creating a revision that touches no files, but this can break regular conversions from some repositories: - conceptually, since we're converting a repo, we should try to make the new hg repo as similar as possible to the original repo - we should create a new changeset, even if the original revision didn't touch any files (maybe the commit message had some important bit); - even if a "regular" revision that doesn't touch any file may seem weird (and maybe even broken), it's completely legitimate for a merge revision to not touch any file, and, if we just skip it, the converted repo will end up with wrong history and possibly an extra head. As an example, say the crew and main hg repos are sync'ed. Somebody sends an important patch to the mailing list. Matt quickly applies and pushes it. But at the same time somebody also applies it to crew and pushes it. Suppose the commit message ended up being a bit different (say, there was a typo and somebody didn't fix it) or that the date ended up being different (because of different patch-applying scripts): the changeset hashes will be different, but the manifests will be the same. Since both changesets were pushed to public repos, it's hard to recall them. If both are merged, the manifest from the resulting merge revision will have the exact same contents as its parents - i.e. the merge revision really doesn't touch any file at all. To keep the file filtering stuff "working", the generic code was changed to skip empty revisions if we're filtering the repo, fixing a bug in the process (we want parents[0] instead of tip).
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 17 Aug 2007 20:18:05 -0300
parents e0bc2c575044
children
line wrap: on
line source

adding a
changeset:   0:8580ff50825a
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     a

% -f, directory
abort: can only follow copies/renames for explicit file names
% -f, but no args
changeset:   4:b30c444c7c84
tag:         tip
user:        test
date:        Thu Jan 01 00:00:05 1970 +0000
summary:     e

changeset:   3:16b60bf3f99a
user:        test
date:        Thu Jan 01 00:00:04 1970 +0000
summary:     d

changeset:   2:21fba396af4c
user:        test
date:        Thu Jan 01 00:00:03 1970 +0000
summary:     c

changeset:   1:c0296dabce9b
user:        test
date:        Thu Jan 01 00:00:02 1970 +0000
summary:     b

changeset:   0:8580ff50825a
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     a

% one rename
changeset:   0:8580ff50825a
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
files:       a
description:
a


% many renames
changeset:   4:b30c444c7c84
tag:         tip
user:        test
date:        Thu Jan 01 00:00:05 1970 +0000
files:       dir/b e
description:
e


changeset:   2:21fba396af4c
user:        test
date:        Thu Jan 01 00:00:03 1970 +0000
files:       b dir/b
description:
c


changeset:   1:c0296dabce9b
user:        test
date:        Thu Jan 01 00:00:02 1970 +0000
files:       b
description:
b


changeset:   0:8580ff50825a
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
files:       a
description:
a


% log copies
4 e (dir/b)
3 b (a)
2 dir/b (b)
1 b (a)
0 
% log copies, non-linear manifest
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
adding foo
5 e (dir/b)
% log -p d
changeset:   3:16b60bf3f99a
user:        test
date:        Thu Jan 01 00:00:04 1970 +0000
files:       a b d
description:
d


diff -r 21fba396af4c -r 16b60bf3f99a d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/d	Thu Jan 01 00:00:04 1970 +0000
@@ -0,0 +1,1 @@
+a

adding base
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
adding b1
% log -f
changeset:   3:e62f78d544b4
tag:         tip
parent:      1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1

changeset:   1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     r1

changeset:   0:67e992f2c4f3
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     base

1 files updated, 0 files merged, 1 files removed, 0 files unresolved
adding b2
% log -f -r 1:tip
changeset:   1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     r1

changeset:   2:60c670bf5b30
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     r2

changeset:   3:e62f78d544b4
parent:      1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1

2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
% log -r . with two parents
warning: working directory has two parents, tag '.' uses the first
changeset:   3:e62f78d544b4
parent:      1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1

% log -r . with one parent
changeset:   5:302e9dd6890d
tag:         tip
parent:      3:e62f78d544b4
parent:      4:ddb82e70d1a1
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     m12

% log --follow-first
changeset:   6:2404bbcab562
tag:         tip
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1.1

changeset:   5:302e9dd6890d
parent:      3:e62f78d544b4
parent:      4:ddb82e70d1a1
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     m12

changeset:   3:e62f78d544b4
parent:      1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1

changeset:   1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     r1

changeset:   0:67e992f2c4f3
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     base

% log -P 2
changeset:   6:2404bbcab562
tag:         tip
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1.1

changeset:   5:302e9dd6890d
parent:      3:e62f78d544b4
parent:      4:ddb82e70d1a1
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     m12

changeset:   4:ddb82e70d1a1
parent:      0:67e992f2c4f3
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b2

changeset:   3:e62f78d544b4
parent:      1:3d5bf5654eda
user:        test
date:        Thu Jan 01 00:00:01 1970 +0000
summary:     b1

% log -r ""
abort: Ambiguous identifier!