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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
1 $ hg init t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
2 $ cd t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
3 $ echo 1 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
4 $ hg ci -Am m
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
5 adding foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
6
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
7 $ cd ..
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
8 $ hg clone t tt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
9 updating to branch default
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
11 $ cd tt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
12 $ echo 1.1 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
15 $ cd ../t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
16 $ echo 1.2 > foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
17 $ hg ci -Am m
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
21 $ hg pull -u ../tt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
22 pulling from ../tt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
23 searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
24 adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
25 adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
26 adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
30
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
34
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
35 $ hg pull -u ../t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
36 pulling from ../t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
37 searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
38 adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
39 adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
40 adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
45 $ HGMERGE=true hg merge
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
46 merging foo
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
47 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
48 (branch merge, don't forget to commit)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
49 $ hg ci -mm
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
50
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
51 $ cd ../t
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
52
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
55 $ hg pull -u ../tt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
56 pulling from ../tt
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
57 searching for changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
58 adding changesets
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
59 adding manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
60 adding file changes
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
61 added 1 changesets with 1 changes to 1 files (-1 heads)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5080
diff changeset
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 ..