##// END OF EJS Templates
tests: add test for path conflicts during merge...
Mark Thomas -
r34559:f71c712e default
parent child Browse files
Show More
@@ -0,0 +1,128 b''
1 $ hg init repo
2 $ cd repo
3 $ echo base > base
4 $ hg add base
5 $ hg commit -m "base"
6 $ hg bookmark -i base
7 $ mkdir a
8 $ echo 1 > a/b
9 $ hg add a/b
10 $ hg commit -m "file"
11 $ hg bookmark -i file
12 $ echo 2 > a/b
13 $ hg commit -m "file2"
14 $ hg bookmark -i file2
15 $ hg up 0
16 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
17 $ mkdir a
18 $ ln -s c a/b
19 $ hg add a/b
20 $ hg commit -m "link"
21 created new head
22 $ hg bookmark -i link
23 $ hg up 0
24 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
25 $ mkdir -p a/b/c
26 $ echo 2 > a/b/c/d
27 $ hg add a/b/c/d
28 $ hg commit -m "dir"
29 created new head
30 $ hg bookmark -i dir
31
32 Merge - local file conflicts with remote directory
33
34 $ hg up file
35 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
36 (activating bookmark file)
37 $ hg bookmark -i
38 $ hg merge --verbose dir
39 resolving manifests
40 a/b: path conflict - a file or link has the same name as a directory
41 the local file has been renamed to a/b~0ed027b96f31
42 resolve manually then use 'hg resolve --mark a/b'
43 moving a/b to a/b~0ed027b96f31 (glob)
44 getting a/b/c/d
45 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
46 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
47 [1]
48 $ hg status
49 M a/b/c/d
50 A a/b~0ed027b96f31
51 R a/b
52 $ hg resolve --all
53 a/b: path conflict must be resolved manually
54 $ hg forget a/b~0ed027b96f31 && rm a/b~0ed027b96f31
55 $ hg resolve --mark a/b
56 (no more unresolved files)
57 $ hg commit -m "merge file and dir (deleted file)"
58
59 Merge - local symlink conflicts with remote directory
60
61 $ hg up link
62 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
63 (activating bookmark link)
64 $ hg bookmark -i
65 $ hg merge dir
66 a/b: path conflict - a file or link has the same name as a directory
67 the local file has been renamed to a/b~2ea68033e3be
68 resolve manually then use 'hg resolve --mark a/b'
69 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
70 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
71 [1]
72 $ hg status
73 M a/b/c/d
74 A a/b~2ea68033e3be
75 R a/b
76 $ hg resolve --list
77 P a/b
78 $ hg resolve --all
79 a/b: path conflict must be resolved manually
80 $ hg mv a/b~2ea68033e3be a/b.old
81 $ hg resolve --mark a/b
82 (no more unresolved files)
83 $ hg resolve --list
84 R a/b
85 $ hg commit -m "merge link and dir (renamed link)"
86
87 Merge - local directory conflicts with remote file or link
88
89 $ hg up dir
90 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
91 (activating bookmark dir)
92 $ hg bookmark -i
93 $ hg merge file
94 a/b: path conflict - a file or link has the same name as a directory
95 the remote file has been renamed to a/b~0ed027b96f31
96 resolve manually then use 'hg resolve --mark a/b'
97 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
98 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
99 [1]
100 $ hg status
101 A a/b~0ed027b96f31
102 $ hg resolve --all
103 a/b: path conflict must be resolved manually
104 $ hg mv a/b~0ed027b96f31 a/b/old-b
105 $ hg resolve --mark a/b
106 (no more unresolved files)
107 $ hg commit -m "merge dir and file (move file into dir)"
108 created new head
109 $ hg merge file2
110 merging a/b/old-b and a/b to a/b/old-b
111 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
112 (branch merge, don't forget to commit)
113 $ cat a/b/old-b
114 2
115 $ hg commit -m "merge file2 (copytrace tracked rename)"
116 $ hg merge link
117 a/b: path conflict - a file or link has the same name as a directory
118 the remote file has been renamed to a/b~2ea68033e3be
119 resolve manually then use 'hg resolve --mark a/b'
120 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
121 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
122 [1]
123 $ hg mv a/b~2ea68033e3be a/b.old
124 $ readlink a/b.old
125 c
126 $ hg resolve --mark a/b
127 (no more unresolved files)
128 $ hg commit -m "merge link (rename link)"
General Comments 0
You need to be logged in to leave comments. Login now