Mercurial > hg
annotate tests/test-pull-update.t @ 28273:9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
Before this patch, "hg pull -u" with a target doesn't activate a bookmark, which
matches with the explicit destination of the update, even though bare "hg
update" does so.
A "target" can be provided through:
- option --rev BOOKMARK
- source URL#BOOKMARK
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 26 Feb 2016 20:22:05 +0900 |
parents | 6b1fc09c699a |
children | 5d9578d9ad1a |
rev | line source |
---|---|
12279 | 1 $ hg init t |
2 $ cd t | |
3 $ echo 1 > foo | |
4 $ hg ci -Am m | |
5 adding foo | |
6 | |
7 $ cd .. | |
8 $ hg clone t tt | |
9 updating to branch default | |
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
11 $ cd tt | |
12 $ echo 1.1 > foo | |
13 $ hg ci -Am m | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
14 |
12279 | 15 $ cd ../t |
16 $ echo 1.2 > foo | |
17 $ hg ci -Am m | |
18 | |
28065
6b1fc09c699a
update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26968
diff
changeset
|
19 Should not update to the other topological branch: |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
20 |
12279 | 21 $ hg pull -u ../tt |
22 pulling from ../tt | |
23 searching for changes | |
24 adding changesets | |
25 adding manifests | |
26 adding file changes | |
27 added 1 changesets with 1 changes to 1 files (+1 heads) | |
28065
6b1fc09c699a
update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26968
diff
changeset
|
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6b1fc09c699a
update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26968
diff
changeset
|
29 1 other heads for branch "default" |
12279 | 30 |
31 $ cd ../tt | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
32 |
28065
6b1fc09c699a
update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26968
diff
changeset
|
33 Should not update to the other branch: |
12279 | 34 |
35 $ hg pull -u ../t | |
36 pulling from ../t | |
37 searching for changes | |
38 adding changesets | |
39 adding manifests | |
40 adding file changes | |
41 added 1 changesets with 1 changes to 1 files (+1 heads) | |
28065
6b1fc09c699a
update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26968
diff
changeset
|
42 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
6b1fc09c699a
update: change default destination to tipmost descendant (issue4673) (BC)
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
26968
diff
changeset
|
43 1 other heads for branch "default" |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
44 |
12279 | 45 $ HGMERGE=true hg merge |
46 merging foo | |
47 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
48 (branch merge, don't forget to commit) | |
49 $ hg ci -mm | |
50 | |
51 $ cd ../t | |
52 | |
53 Should work: | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
54 |
12279 | 55 $ hg pull -u ../tt |
56 pulling from ../tt | |
57 searching for changes | |
58 adding changesets | |
59 adding manifests | |
60 adding file changes | |
61 added 1 changesets with 1 changes to 1 files (-1 heads) | |
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
63 | |
28273
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
64 Similarity between "hg update" and "hg pull -u" in handling bookmark |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
65 ==================================================================== |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
66 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
67 Test that updating activates the bookmark, which matches with the |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
68 explicit destination of the update. |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
69 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
70 $ echo 4 >> foo |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
71 $ hg commit -m "#4" |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
72 $ hg bookmark active-after-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
73 $ cd ../tt |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
74 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
75 (1) activating by --rev BOOKMARK |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
76 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
77 $ hg bookmark -f active-before-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
78 $ hg bookmarks |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
79 * active-before-pull 3:483b76ad4309 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
80 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
81 $ hg pull -u -r active-after-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
82 pulling from $TESTTMP/t (glob) |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
83 searching for changes |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
84 adding changesets |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
85 adding manifests |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
86 adding file changes |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
87 added 1 changesets with 1 changes to 1 files |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
88 adding remote bookmark active-after-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
90 (activating bookmark active-after-pull) |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
91 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
92 $ hg parents -q |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
93 4:f815b3da6163 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
94 $ hg bookmarks |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
95 * active-after-pull 4:f815b3da6163 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
96 active-before-pull 3:483b76ad4309 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
97 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
98 (discard pulled changes) |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
99 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
100 $ hg update -q 483b76ad4309 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
101 $ hg rollback -q |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
102 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
103 (2) activating by URL#BOOKMARK |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
104 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
105 $ hg bookmark -f active-before-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
106 $ hg bookmarks |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
107 * active-before-pull 3:483b76ad4309 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
108 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
109 $ hg pull -u $TESTTMP/t#active-after-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
110 pulling from $TESTTMP/t (glob) |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
111 searching for changes |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
112 adding changesets |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
113 adding manifests |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
114 adding file changes |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
115 added 1 changesets with 1 changes to 1 files |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
116 adding remote bookmark active-after-pull |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
118 (activating bookmark active-after-pull) |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
119 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
120 $ hg parents -q |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
121 4:f815b3da6163 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
122 $ hg bookmarks |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
123 * active-after-pull 4:f815b3da6163 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
124 active-before-pull 3:483b76ad4309 |
9ac8955d8c45
pull: activate a bookmark matching with the destination of the update (BC)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
28065
diff
changeset
|
125 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
14485
diff
changeset
|
126 $ cd .. |