annotate tests/test-rename-dir-merge.t @ 48365:67064c238ae7

errors: use detailed exit code for non-integer number of diff context lines Differential Revision: https://phab.mercurial-scm.org/D11826
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 19 Nov 2021 15:38:36 -0800
parents b7fde9237c92
children 473af5cbc209
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
48335
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 46634
diff changeset
1 TODO: fix rhg bugs that make this test fail when status is enabled
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 46634
diff changeset
2 $ unset RHG_STATUS
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 46634
diff changeset
3
b7fde9237c92 rhg: Enable `rhg status` in most tests
Simon Sapin <simon.sapin@octobus.net>
parents: 46634
diff changeset
4
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 12114
diff changeset
5 $ hg init t
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
6 $ cd t
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
7
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
8 $ mkdir a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
9 $ echo foo > a/a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
10 $ echo bar > a/b
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
11 $ hg ci -Am "0"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
12 adding a/a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
13 adding a/b
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
14
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
15 $ hg co -C 0
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
16 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
17 $ hg mv a b
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
18 moving a/a to b/a
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
19 moving a/b to b/b
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
20 $ hg ci -m "1 mv a/ b/"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
21
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
22 $ hg co -C 0
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
23 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
24 $ echo baz > a/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
25 $ echo quux > a/d
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
26 $ hg add a/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
27 $ hg ci -m "2 add a/c"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
28 created new head
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
29
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
30 $ hg merge --debug 1
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
31 unmatched files in local:
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
32 a/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
33 unmatched files in other:
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
34 b/a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
35 b/b
16795
e9ae770eff1c merge: show renamed on one and deleted on the other side in debug output
Thomas Arendsen Hein <thomas@intevation.de>
parents: 16094
diff changeset
36 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
44197
17e12938f8e7 copies: print debug information about copies per side/branch
Martin von Zweigbergk <martinvonz@google.com>
parents: 42167
diff changeset
37 on remote side:
17e12938f8e7 copies: print debug information about copies per side/branch
Martin von Zweigbergk <martinvonz@google.com>
parents: 42167
diff changeset
38 src: 'a/a' -> dst: 'b/a'
17e12938f8e7 copies: print debug information about copies per side/branch
Martin von Zweigbergk <martinvonz@google.com>
parents: 42167
diff changeset
39 src: 'a/b' -> dst: 'b/b'
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
40 checking for directory renames
18135
a6fe1b9cc68f copies: make debug messages more sensible
Siddharth Agarwal <sid0@fb.com>
parents: 16913
diff changeset
41 discovered dir src: 'a/' -> dst: 'b/'
a6fe1b9cc68f copies: make debug messages more sensible
Siddharth Agarwal <sid0@fb.com>
parents: 16913
diff changeset
42 pending file src: 'a/c' -> dst: 'b/c'
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
43 resolving manifests
18605
bcf29565d89f manifestmerge: pass in branchmerge and force separately
Siddharth Agarwal <sid0@fb.com>
parents: 18360
diff changeset
44 branchmerge: True, force: False, partial: False
15625
efdcce3fd2d5 merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
45 ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
18360
760c0d67ce5e merge: process files in sorted order
Mads Kiilerich <mads@kiilerich.com>
parents: 18135
diff changeset
46 a/a: other deleted -> r
21391
cb15835456cb merge: change debug logging - test output changes but no real changes
Mads Kiilerich <madski@unity3d.com>
parents: 20944
diff changeset
47 removing a/a
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
48 a/b: other deleted -> r
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
49 removing a/b
21391
cb15835456cb merge: change debug logging - test output changes but no real changes
Mads Kiilerich <madski@unity3d.com>
parents: 20944
diff changeset
50 b/a: remote created -> g
18631
e2dc5397bc82 tests: update test output (will be folded into parent)
Bryan O'Sullivan <bryano@fb.com>
parents: 18605
diff changeset
51 getting b/a
21391
cb15835456cb merge: change debug logging - test output changes but no real changes
Mads Kiilerich <madski@unity3d.com>
parents: 20944
diff changeset
52 b/b: remote created -> g
18631
e2dc5397bc82 tests: update test output (will be folded into parent)
Bryan O'Sullivan <bryano@fb.com>
parents: 18605
diff changeset
53 getting b/b
21391
cb15835456cb merge: change debug logging - test output changes but no real changes
Mads Kiilerich <madski@unity3d.com>
parents: 20944
diff changeset
54 b/c: remote directory rename - move from a/c -> dm
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
55 moving a/c to b/c
16094
0776a6cababe merge: don't use unknown()
Matt Mackall <mpm@selenic.com>
parents: 15625
diff changeset
56 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
57 (branch merge, don't forget to commit)
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
58
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
59 $ echo a/* b/*
16094
0776a6cababe merge: don't use unknown()
Matt Mackall <mpm@selenic.com>
parents: 15625
diff changeset
60 a/d b/a b/b b/c
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
61 $ hg st -C
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
62 M b/a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
63 M b/b
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
64 A b/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
65 a/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
66 R a/a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
67 R a/b
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
68 R a/c
16094
0776a6cababe merge: don't use unknown()
Matt Mackall <mpm@selenic.com>
parents: 15625
diff changeset
69 ? a/d
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
70 $ hg ci -m "3 merge 2+1"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
71 $ hg debugrename b/c
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
72 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
73
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
74 $ hg co -C 1
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
75 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
76 $ hg merge --debug 2
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
77 unmatched files in local:
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
78 b/a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
79 b/b
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
80 unmatched files in other:
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
81 a/c
16795
e9ae770eff1c merge: show renamed on one and deleted on the other side in debug output
Thomas Arendsen Hein <thomas@intevation.de>
parents: 16094
diff changeset
82 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
44197
17e12938f8e7 copies: print debug information about copies per side/branch
Martin von Zweigbergk <martinvonz@google.com>
parents: 42167
diff changeset
83 on local side:
17e12938f8e7 copies: print debug information about copies per side/branch
Martin von Zweigbergk <martinvonz@google.com>
parents: 42167
diff changeset
84 src: 'a/a' -> dst: 'b/a'
17e12938f8e7 copies: print debug information about copies per side/branch
Martin von Zweigbergk <martinvonz@google.com>
parents: 42167
diff changeset
85 src: 'a/b' -> dst: 'b/b'
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
86 checking for directory renames
18135
a6fe1b9cc68f copies: make debug messages more sensible
Siddharth Agarwal <sid0@fb.com>
parents: 16913
diff changeset
87 discovered dir src: 'a/' -> dst: 'b/'
a6fe1b9cc68f copies: make debug messages more sensible
Siddharth Agarwal <sid0@fb.com>
parents: 16913
diff changeset
88 pending file src: 'a/c' -> dst: 'b/c'
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
89 resolving manifests
18605
bcf29565d89f manifestmerge: pass in branchmerge and force separately
Siddharth Agarwal <sid0@fb.com>
parents: 18360
diff changeset
90 branchmerge: True, force: False, partial: False
15625
efdcce3fd2d5 merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents: 15447
diff changeset
91 ancestor: f9b20c0d4c51, local: 397f8b00a740+, remote: ce36d17b18fb
28318
564a354f7f35 tests: flag Windows specific lines about background closing as optional
Matt Harbison <matt_harbison@yahoo.com>
parents: 27876
diff changeset
92 starting 4 threads for background file closing (?)
20944
5b8d5803d7b7 merge: keep destination filename as key in actions for merge with dir rename
Mads Kiilerich <madski@unity3d.com>
parents: 19133
diff changeset
93 b/c: local directory rename - get from a/c -> dg
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
94 getting a/c to b/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
96 (branch merge, don't forget to commit)
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
97
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
98 $ echo a/* b/*
16094
0776a6cababe merge: don't use unknown()
Matt Mackall <mpm@selenic.com>
parents: 15625
diff changeset
99 a/d b/a b/b b/c
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
100 $ hg st -C
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
101 A b/c
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
102 a/c
16094
0776a6cababe merge: don't use unknown()
Matt Mackall <mpm@selenic.com>
parents: 15625
diff changeset
103 ? a/d
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
104 $ hg ci -m "4 merge 1+2"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
105 created new head
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
106 $ hg debugrename b/c
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
107 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
108
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
109 Local directory rename with conflicting file added in remote source directory
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
110 and untracked in local target directory.
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
111
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
112 $ hg co -qC 1
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
113 $ echo target > b/c
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
114 $ hg merge 2
23653
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
115 b/c: untracked file differs
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
116 abort: untracked files in working directory differ from files in requested revision
46418
dc00324e80f4 errors: use StateError more in merge module
Martin von Zweigbergk <martinvonz@google.com>
parents: 44197
diff changeset
117 [20]
23653
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
118 $ cat b/c
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
119 target
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
120 but it should succeed if the content matches
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
121 $ hg cat -r 2 a/c > b/c
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
122 $ hg merge 2
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
123 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
124 (branch merge, don't forget to commit)
23653
0297d8469350 merge: don't overwrite untracked file at directory rename target
Martin von Zweigbergk <martinvonz@google.com>
parents: 23476
diff changeset
125 $ hg st -C
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
126 A b/c
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
127 a/c
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
128 ? a/d
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
129
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
130 Local directory rename with conflicting file added in remote source directory
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
131 and committed in local target directory.
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
132
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
133 $ hg co -qC 1
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
134 $ echo target > b/c
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
135 $ hg add b/c
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
136 $ hg commit -qm 'new file in target directory'
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
137 $ hg merge 2
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
138 merging b/c and a/c to b/c
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25125
diff changeset
139 warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark')
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
140 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35393
diff changeset
141 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
142 [1]
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
143 $ hg st -A
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
144 M b/c
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
145 a/c
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
146 ? a/d
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
147 ? b/c.orig
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
148 C b/a
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
149 C b/b
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
150 $ cat b/c
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28318
diff changeset
151 <<<<<<< working copy: f1c50ca4f127 - test: new file in target directory
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
152 target
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
153 =======
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
154 baz
30460
ce3a133f71b3 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents: 30062
diff changeset
155 >>>>>>> merge rev: ce36d17b18fb - test: 2 add a/c
23476
39a12719ec65 merge: don't overwrite conflicting file in locally renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23475
diff changeset
156 $ rm b/c.orig
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
157
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
158 Remote directory rename with conflicting file added in remote target directory
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
159 and committed in local source directory.
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
160
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
161 $ hg co -qC 2
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
162 $ hg st -A
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
163 ? a/d
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
164 C a/a
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
165 C a/b
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
166 C a/c
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
167 $ hg merge 5
23475
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
168 merging a/c and b/c to b/c
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25125
diff changeset
169 warning: conflicts while merging b/c! (edit, then use 'hg resolve --mark')
23475
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
170 2 files updated, 0 files merged, 2 files removed, 1 files unresolved
35704
41ef02ba329b merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35393
diff changeset
171 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
23475
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
172 [1]
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
173 $ hg st -A
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
174 M b/a
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
175 M b/b
23475
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
176 M b/c
23464
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
177 a/c
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
178 R a/a
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
179 R a/b
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
180 R a/c
73d4f6551798 merge: add test with conflicting file and remote directory rename
Martin von Zweigbergk <martinvonz@google.com>
parents: 23444
diff changeset
181 ? a/d
23475
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
182 ? b/c.orig
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
183 $ cat b/c
30460
ce3a133f71b3 conflicts: make spacing consistent in conflict markers
Kostia Balytskyi <ikostia@fb.com>
parents: 30062
diff changeset
184 <<<<<<< working copy: ce36d17b18fb - test: 2 add a/c
23444
88629daa727b merge: demonstrate that directory renames can lose local file content
Martin von Zweigbergk <martinvonz@google.com>
parents: 21391
diff changeset
185 baz
23475
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
186 =======
67f1d68861fb merge: don't ignore conflicting file in remote renamed directory
Martin von Zweigbergk <martinvonz@google.com>
parents: 23464
diff changeset
187 target
30062
940c05b25b07 merge: add conflict labels to merge command
Simon Farnsworth <simonfar@fb.com>
parents: 28318
diff changeset
188 >>>>>>> merge rev: f1c50ca4f127 - test: new file in target directory
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
189
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
190 Second scenario with two repos:
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
191
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
192 $ cd ..
13956
ffb5c09ba822 tests: remove redundant mkdir
Martin Geisler <mg@lazybytes.net>
parents: 12114
diff changeset
193 $ hg init r1
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
194 $ cd r1
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
195 $ mkdir a
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
196 $ echo foo > a/f
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
197 $ hg add a
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
198 adding a/f
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
199 $ hg ci -m "a/f == foo"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
200 $ cd ..
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
201
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
202 $ hg clone r1 r2
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
203 updating to branch default
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
204 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
205 $ cd r2
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
206 $ hg mv a b
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
207 moving a/f to b/f
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
208 $ echo foo1 > b/f
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
209 $ hg ci -m" a -> b, b/f == foo1"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
210 $ cd ..
3733
9e67fecbfd16 merge: handle directory renames
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
211
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
212 $ cd r1
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
213 $ mkdir a/aa
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
214 $ echo bar > a/aa/g
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
215 $ hg add a/aa
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34661
diff changeset
216 adding a/aa/g
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
217 $ hg ci -m "a/aa/g"
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
218 $ hg pull ../r2
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
219 pulling from ../r2
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
220 searching for changes
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
221 adding changesets
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
222 adding manifests
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
223 adding file changes
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
224 added 1 changesets with 1 changes to 1 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30460
diff changeset
225 new changesets 7d51ed18da25
38250
d0abd7949ea3 phases: use "published" in the phase movement message
Boris Feld <boris.feld@octobus.net>
parents: 38249
diff changeset
226 1 local changesets published
12114
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
227 (run 'hg heads' to see heads, 'hg merge' to merge)
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
228
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
229 $ hg merge
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
230 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
231 (branch merge, don't forget to commit)
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
232
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
233 $ hg st -C
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
234 M b/f
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
235 A b/aa/g
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
236 a/aa/g
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
237 R a/aa/g
0a6b2e21bc86 tests: merge the two test-rename-dir-merge* into one
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8167
diff changeset
238 R a/f
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16795
diff changeset
239
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16795
diff changeset
240 $ cd ..
27876
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
241
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
242 Test renames to separate directories
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
243
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
244 $ hg init a
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
245 $ cd a
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
246 $ mkdir a
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
247 $ touch a/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
248 $ touch a/t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
249 $ hg ci -Am0
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
250 adding a/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
251 adding a/t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
252
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
253 Add more files
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
254
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
255 $ touch a/s2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
256 $ touch a/t2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
257 $ hg ci -Am1
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
258 adding a/s2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
259 adding a/t2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
260
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
261 Do moves on a branch
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
262
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
263 $ hg up 0
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
264 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
265 $ mkdir s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
266 $ mkdir t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
267 $ hg mv a/s s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
268 $ hg mv a/t t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
269 $ hg ci -Am2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
270 created new head
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
271 $ hg st --copies --change .
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
272 A s/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
273 a/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
274 A t/t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
275 a/t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
276 R a/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
277 R a/t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
278
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
279 Merge shouldn't move s2, t2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
280
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
281 $ hg merge
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
282 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
283 (branch merge, don't forget to commit)
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
284 $ hg st --copies
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
285 M a/s2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
286 M a/t2
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
287
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
288 Try the merge in the other direction. It may or may not be appropriate for
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
289 status to list copies here.
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
290
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
291 $ hg up -C 1
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
292 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
293 $ hg merge
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
294 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
295 (branch merge, don't forget to commit)
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
296 $ hg st --copies
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
297 M s/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
298 M t/t
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
299 R a/s
602add6ad9e5 copies: fix detection of divergent directory renames
Matt Mackall <mpm@selenic.com>
parents: 26614
diff changeset
300 R a/t
46634
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
301
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
302 $ cd ..
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
303
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
304
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
305 Test that files are moved to a new directory based on the path prefix that
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
306 matches the most. dir1/ below gets renamed to dir2/, and dir1/subdir1/ gets
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
307 renamed to dir2/subdir2/. We want dir1/subdir1/newfile to move to
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
308 dir2/subdir2/ (not to dir2/subdir1/ as we would infer based on just the rename
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
309 of dir1/ to dir2/).
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
310
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
311 $ hg init nested-renames
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
312 $ cd nested-renames
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
313 $ mkdir dir1
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
314 $ echo a > dir1/file1
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
315 $ echo b > dir1/file2
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
316 $ mkdir dir1/subdir1
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
317 $ echo c > dir1/subdir1/file3
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
318 $ echo d > dir1/subdir1/file4
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
319 $ hg ci -Aqm initial
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
320 $ hg mv dir1 dir2
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
321 moving dir1/file1 to dir2/file1
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
322 moving dir1/file2 to dir2/file2
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
323 moving dir1/subdir1/file3 to dir2/subdir1/file3
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
324 moving dir1/subdir1/file4 to dir2/subdir1/file4
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
325 $ hg mv dir2/subdir1 dir2/subdir2
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
326 moving dir2/subdir1/file3 to dir2/subdir2/file3
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
327 moving dir2/subdir1/file4 to dir2/subdir2/file4
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
328 $ hg ci -m 'move dir1/ to dir2/ and dir1/subdir1/ to dir2/subdir2/'
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
329 $ hg co 0
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
330 4 files updated, 0 files merged, 4 files removed, 0 files unresolved
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
331 $ echo e > dir1/subdir1/file5
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
332 $ hg ci -Aqm 'add file in dir1/subdir1/'
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
333 $ hg merge 1
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
334 5 files updated, 0 files merged, 4 files removed, 0 files unresolved
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
335 (branch merge, don't forget to commit)
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
336 $ hg files
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
337 dir2/file1
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
338 dir2/file2
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
339 dir2/subdir2/file3
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
340 dir2/subdir2/file4
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
341 dir2/subdir2/file5
ad30b29bc23d copies: choose target directory based on longest match
Martin von Zweigbergk <martinvonz@google.com>
parents: 46418
diff changeset
342 $ cd ..