Show More
@@ -0,0 +1,23 b'' | |||||
|
1 | Test update.requiredest | |||
|
2 | $ cd $TESTTMP | |||
|
3 | $ cat >> $HGRCPATH <<EOF | |||
|
4 | > [commands] | |||
|
5 | > update.requiredest = True | |||
|
6 | > EOF | |||
|
7 | $ hg init repo | |||
|
8 | $ cd repo | |||
|
9 | $ echo a >> a | |||
|
10 | $ hg commit -qAm aa | |||
|
11 | $ hg up | |||
|
12 | abort: you must specify a destination | |||
|
13 | (for example: hg update ".::") | |||
|
14 | [255] | |||
|
15 | $ hg up . | |||
|
16 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
17 | $ HGPLAIN=1 hg up | |||
|
18 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
19 | $ hg --config commands.update.requiredest=False up | |||
|
20 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
21 | ||||
|
22 | $ cd .. | |||
|
23 |
@@ -1,110 +1,90 b'' | |||||
1 | Test update logic when there are renames or weird same-name cases between dirs |
|
1 | Test update logic when there are renames or weird same-name cases between dirs | |
2 | and files |
|
2 | and files | |
3 |
|
3 | |||
4 | Update with local changes across a file rename |
|
4 | Update with local changes across a file rename | |
5 |
|
5 | |||
6 | $ hg init r1 && cd r1 |
|
6 | $ hg init r1 && cd r1 | |
7 |
|
7 | |||
8 | $ echo a > a |
|
8 | $ echo a > a | |
9 | $ hg add a |
|
9 | $ hg add a | |
10 | $ hg ci -m a |
|
10 | $ hg ci -m a | |
11 |
|
11 | |||
12 | $ hg mv a b |
|
12 | $ hg mv a b | |
13 | $ hg ci -m rename |
|
13 | $ hg ci -m rename | |
14 |
|
14 | |||
15 | $ echo b > b |
|
15 | $ echo b > b | |
16 | $ hg ci -m change |
|
16 | $ hg ci -m change | |
17 |
|
17 | |||
18 | $ hg up -q 0 |
|
18 | $ hg up -q 0 | |
19 |
|
19 | |||
20 | $ echo c > a |
|
20 | $ echo c > a | |
21 |
|
21 | |||
22 | $ hg up |
|
22 | $ hg up | |
23 | merging a and b to b |
|
23 | merging a and b to b | |
24 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
|
24 | warning: conflicts while merging b! (edit, then use 'hg resolve --mark') | |
25 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
25 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
26 | use 'hg resolve' to retry unresolved file merges |
|
26 | use 'hg resolve' to retry unresolved file merges | |
27 | [1] |
|
27 | [1] | |
28 |
|
28 | |||
29 | Test update when local untracked directory exists with the same name as a |
|
29 | Test update when local untracked directory exists with the same name as a | |
30 | tracked file in a commit we are updating to |
|
30 | tracked file in a commit we are updating to | |
31 | $ hg init r2 && cd r2 |
|
31 | $ hg init r2 && cd r2 | |
32 | $ echo root > root && hg ci -Am root # rev 0 |
|
32 | $ echo root > root && hg ci -Am root # rev 0 | |
33 | adding root |
|
33 | adding root | |
34 | $ echo text > name && hg ci -Am "name is a file" # rev 1 |
|
34 | $ echo text > name && hg ci -Am "name is a file" # rev 1 | |
35 | adding name |
|
35 | adding name | |
36 | $ hg up 0 |
|
36 | $ hg up 0 | |
37 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
37 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
38 | $ mkdir name |
|
38 | $ mkdir name | |
39 | $ hg up 1 |
|
39 | $ hg up 1 | |
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
40 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
41 |
|
41 | |||
42 | Test update when local untracked directory exists with some files in it and has |
|
42 | Test update when local untracked directory exists with some files in it and has | |
43 | the same name a tracked file in a commit we are updating to. In future this |
|
43 | the same name a tracked file in a commit we are updating to. In future this | |
44 | should be updated to give an friendlier error message, but now we should just |
|
44 | should be updated to give an friendlier error message, but now we should just | |
45 | make sure that this does not erase untracked data |
|
45 | make sure that this does not erase untracked data | |
46 | $ hg up 0 |
|
46 | $ hg up 0 | |
47 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
47 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
48 | $ mkdir name |
|
48 | $ mkdir name | |
49 | $ echo text > name/file |
|
49 | $ echo text > name/file | |
50 | $ hg st |
|
50 | $ hg st | |
51 | ? name/file |
|
51 | ? name/file | |
52 | $ hg up 1 |
|
52 | $ hg up 1 | |
53 | abort: *: '$TESTTMP/r1/r2/name' (glob) |
|
53 | abort: *: '$TESTTMP/r1/r2/name' (glob) | |
54 | [255] |
|
54 | [255] | |
55 | $ cd .. |
|
55 | $ cd .. | |
56 |
|
56 | |||
57 | #if symlink |
|
57 | #if symlink | |
58 |
|
58 | |||
59 | Test update when two commits have symlinks that point to different folders |
|
59 | Test update when two commits have symlinks that point to different folders | |
60 | $ hg init r3 && cd r3 |
|
60 | $ hg init r3 && cd r3 | |
61 | $ echo root > root && hg ci -Am root |
|
61 | $ echo root > root && hg ci -Am root | |
62 | adding root |
|
62 | adding root | |
63 | $ mkdir folder1 && mkdir folder2 |
|
63 | $ mkdir folder1 && mkdir folder2 | |
64 | $ ln -s folder1 folder |
|
64 | $ ln -s folder1 folder | |
65 | $ hg ci -Am "symlink to folder1" |
|
65 | $ hg ci -Am "symlink to folder1" | |
66 | adding folder |
|
66 | adding folder | |
67 | $ rm folder |
|
67 | $ rm folder | |
68 | $ ln -s folder2 folder |
|
68 | $ ln -s folder2 folder | |
69 | $ hg ci -Am "symlink to folder2" |
|
69 | $ hg ci -Am "symlink to folder2" | |
70 | $ hg up 1 |
|
70 | $ hg up 1 | |
71 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
71 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
72 | $ cd .. |
|
72 | $ cd .. | |
73 |
|
73 | |||
74 | #endif |
|
74 | #endif | |
75 |
|
75 | |||
76 | #if rmcwd |
|
76 | #if rmcwd | |
77 |
|
77 | |||
78 | Test that warning is printed if cwd is deleted during update |
|
78 | Test that warning is printed if cwd is deleted during update | |
79 | $ hg init r4 && cd r4 |
|
79 | $ hg init r4 && cd r4 | |
80 | $ mkdir dir |
|
80 | $ mkdir dir | |
81 | $ cd dir |
|
81 | $ cd dir | |
82 | $ echo a > a |
|
82 | $ echo a > a | |
83 | $ echo b > b |
|
83 | $ echo b > b | |
84 | $ hg add a b |
|
84 | $ hg add a b | |
85 | $ hg ci -m "file and dir" |
|
85 | $ hg ci -m "file and dir" | |
86 | $ hg up -q null |
|
86 | $ hg up -q null | |
87 | current directory was removed |
|
87 | current directory was removed | |
88 | (consider changing to repo root: $TESTTMP/r1/r4) |
|
88 | (consider changing to repo root: $TESTTMP/r1/r4) | |
89 |
|
89 | |||
90 | #endif |
|
90 | #endif | |
91 |
|
||||
92 | $ cd $TESTTMP |
|
|||
93 | $ cat >> $HGRCPATH <<EOF |
|
|||
94 | > [commands] |
|
|||
95 | > update.requiredest = True |
|
|||
96 | > EOF |
|
|||
97 | $ hg init dest |
|
|||
98 | $ cd dest |
|
|||
99 | $ echo a >> a |
|
|||
100 | $ hg commit -qAm aa |
|
|||
101 | $ hg up |
|
|||
102 | abort: you must specify a destination |
|
|||
103 | (for example: hg update ".::") |
|
|||
104 | [255] |
|
|||
105 | $ hg up . |
|
|||
106 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
107 | $ HGPLAIN=1 hg up |
|
|||
108 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
109 | $ hg --config commands.update.requiredest=False up |
|
|||
110 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
General Comments 0
You need to be logged in to leave comments.
Login now