##// END OF EJS Templates
pull: activate a bookmark matching with the destination of the update (BC)...
FUJIWARA Katsunori -
r28273:9ac8955d default
parent child Browse files
Show More
@@ -5566,6 +5566,10 b' def postincoming(ui, repo, modheads, opt'
5566 5566 pass # no-op update
5567 5567 elif bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
5568 5568 ui.status(_("updating bookmark %s\n") % repo._activebookmark)
5569 elif brev in repo._bookmarks:
5570 if brev != repo._activebookmark:
5571 ui.status(_("(activating bookmark %s)\n") % brev)
5572 bookmarks.activate(repo, brev)
5569 5573 return ret
5570 5574 if modheads > 1:
5571 5575 currentbranchheads = len(repo.branchheads())
@@ -61,4 +61,66 b' Should work:'
61 61 added 1 changesets with 1 changes to 1 files (-1 heads)
62 62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 63
64 Similarity between "hg update" and "hg pull -u" in handling bookmark
65 ====================================================================
66
67 Test that updating activates the bookmark, which matches with the
68 explicit destination of the update.
69
70 $ echo 4 >> foo
71 $ hg commit -m "#4"
72 $ hg bookmark active-after-pull
73 $ cd ../tt
74
75 (1) activating by --rev BOOKMARK
76
77 $ hg bookmark -f active-before-pull
78 $ hg bookmarks
79 * active-before-pull 3:483b76ad4309
80
81 $ hg pull -u -r active-after-pull
82 pulling from $TESTTMP/t (glob)
83 searching for changes
84 adding changesets
85 adding manifests
86 adding file changes
87 added 1 changesets with 1 changes to 1 files
88 adding remote bookmark active-after-pull
89 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 (activating bookmark active-after-pull)
91
92 $ hg parents -q
93 4:f815b3da6163
94 $ hg bookmarks
95 * active-after-pull 4:f815b3da6163
96 active-before-pull 3:483b76ad4309
97
98 (discard pulled changes)
99
100 $ hg update -q 483b76ad4309
101 $ hg rollback -q
102
103 (2) activating by URL#BOOKMARK
104
105 $ hg bookmark -f active-before-pull
106 $ hg bookmarks
107 * active-before-pull 3:483b76ad4309
108
109 $ hg pull -u $TESTTMP/t#active-after-pull
110 pulling from $TESTTMP/t (glob)
111 searching for changes
112 adding changesets
113 adding manifests
114 adding file changes
115 added 1 changesets with 1 changes to 1 files
116 adding remote bookmark active-after-pull
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 (activating bookmark active-after-pull)
119
120 $ hg parents -q
121 4:f815b3da6163
122 $ hg bookmarks
123 * active-after-pull 4:f815b3da6163
124 active-before-pull 3:483b76ad4309
125
64 126 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now