tests/test-copy2.out
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Fri, 17 Aug 2007 20:18:05 -0300
changeset 5195 33015dac5df5
parent 4833 fc8b3e7cbf6b
child 5762 c2a21fe60994
permissions -rw-r--r--
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).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4744
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     1
# should fail - foo is not managed
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     2
foo: not copying - file is not managed
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     3
abort: no files to copy
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     4
? foo
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     5
# dry-run; print a warning that this is not a real copy; foo is added
4833
fc8b3e7cbf6b improve warning for hg add foo; hg mv foo bar
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4744
diff changeset
     6
foo has not been committed yet, so no copy data will be stored for bar.
4744
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     7
A foo
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
     8
# should print a warning that this is not a real copy; bar is added
4833
fc8b3e7cbf6b improve warning for hg add foo; hg mv foo bar
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4744
diff changeset
     9
foo has not been committed yet, so no copy data will be stored for bar.
4744
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
    10
A bar
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
    11
# should print a warning that this is not a real copy; foo is added
4833
fc8b3e7cbf6b improve warning for hg add foo; hg mv foo bar
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4744
diff changeset
    12
bar has not been committed yet, so no copy data will be stored for foo.
4744
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
    13
A foo
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
    14
# dry-run; should show that foo is clean
44e17f5029d0 Make hg add foo; hg mv foo bar work.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4743
diff changeset
    15
C foo
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    16
# should show copy
4743
719c402258ee test-copy2: use status -C instead of debugstate | grep copy
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4677
diff changeset
    17
A bar
719c402258ee test-copy2: use status -C instead of debugstate | grep copy
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4677
diff changeset
    18
  foo
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    19
# shouldn't show copy
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    20
# should match
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    21
   rev    offset  length   base linkrev nodeid       p1           p2
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    22
     0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
3652
f4dece0f7016 refactor debugrenamed
Matt Mackall <mpm@selenic.com>
parents: 1127
diff changeset
    23
bar renamed from foo:2ed2a3912a0b24502043eae84ee4b279c18b90dd
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    24
# should not be renamed
3652
f4dece0f7016 refactor debugrenamed
Matt Mackall <mpm@selenic.com>
parents: 1127
diff changeset
    25
bar not renamed
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    26
# should show copy
4743
719c402258ee test-copy2: use status -C instead of debugstate | grep copy
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4677
diff changeset
    27
M bar
719c402258ee test-copy2: use status -C instead of debugstate | grep copy
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4677
diff changeset
    28
  foo
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    29
# should show no parents for tip
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    30
   rev    offset  length   base linkrev nodeid       p1           p2
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    31
     0         0      69      0       1 6ca237634e1f 000000000000 000000000000
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    32
     1        69       6      1       2 7a1ff8e75f5b 6ca237634e1f 000000000000
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    33
     2        75      82      1       3 243dfe60f3d9 000000000000 000000000000
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    34
# should match
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    35
   rev    offset  length   base linkrev nodeid       p1           p2
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    36
     0         0       5      0       0 2ed2a3912a0b 000000000000 000000000000
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    37
     1         5       7      1       2 dd12c926cf16 2ed2a3912a0b 000000000000
3652
f4dece0f7016 refactor debugrenamed
Matt Mackall <mpm@selenic.com>
parents: 1127
diff changeset
    38
bar renamed from foo:dd12c926cf165e3eb4cf87b084955cb617221c17
1117
30ab5b8ee8ec fix some rename/copy bugs
mpm@selenic.com
parents:
diff changeset
    39
# should show no copies
4376
de612b5f8d59 Make copy --after work for files that have been hg added.
Brendan Cully <brendan@kublai.com>
parents: 3652
diff changeset
    40
# copy --after on an added file
de612b5f8d59 Make copy --after work for files that have been hg added.
Brendan Cully <brendan@kublai.com>
parents: 3652
diff changeset
    41
A baz
de612b5f8d59 Make copy --after work for files that have been hg added.
Brendan Cully <brendan@kublai.com>
parents: 3652
diff changeset
    42
  bar
4677
de8ec7e1753a dirstate.status: if a file is marked as copied, consider it modified
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4376
diff changeset
    43
# foo was clean:
de8ec7e1753a dirstate.status: if a file is marked as copied, consider it modified
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4376
diff changeset
    44
C foo
de8ec7e1753a dirstate.status: if a file is marked as copied, consider it modified
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4376
diff changeset
    45
# but it's considered modified after a copy --after --force
de8ec7e1753a dirstate.status: if a file is marked as copied, consider it modified
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4376
diff changeset
    46
M foo
de8ec7e1753a dirstate.status: if a file is marked as copied, consider it modified
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4376
diff changeset
    47
  bar