##// END OF EJS Templates
bookmarks: automatically advance bookmark on naked update (BC) (issue2894)
Matt Mackall -
r15935:6c97eb44 default
parent child Browse files
Show More
@@ -5633,7 +5633,7 def update(ui, repo, node=None, rev=None
5633
5633
5634 Update the repository's working directory to the specified
5634 Update the repository's working directory to the specified
5635 changeset. If no changeset is specified, update to the tip of the
5635 changeset. If no changeset is specified, update to the tip of the
5636 current named branch.
5636 current named branch and move the current bookmark.
5637
5637
5638 If the changeset is not a descendant of the working directory's
5638 If the changeset is not a descendant of the working directory's
5639 parent, the update is aborted. With the -c/--check option, the
5639 parent, the update is aborted. With the -c/--check option, the
@@ -5678,6 +5678,11 def update(ui, repo, node=None, rev=None
5678 if rev is None or rev == '':
5678 if rev is None or rev == '':
5679 rev = node
5679 rev = node
5680
5680
5681 # with no argument, we also move the current bookmark, if any
5682 movemarkfrom = None
5683 if node is None or node == '':
5684 movemarkfrom = repo['.'].node()
5685
5681 # if we defined a bookmark, we have to remember the original bookmark name
5686 # if we defined a bookmark, we have to remember the original bookmark name
5682 brev = rev
5687 brev = rev
5683 rev = scmutil.revsingle(repo, rev, rev).rev()
5688 rev = scmutil.revsingle(repo, rev, rev).rev()
@@ -5701,7 +5706,9 def update(ui, repo, node=None, rev=None
5701 else:
5706 else:
5702 ret = hg.update(repo, rev)
5707 ret = hg.update(repo, rev)
5703
5708
5704 if brev in repo._bookmarks:
5709 if not ret and movemarkfrom:
5710 bookmarks.update(repo, [movemarkfrom], repo['.'].node())
5711 elif brev in repo._bookmarks:
5705 bookmarks.setcurrent(repo, brev)
5712 bookmarks.setcurrent(repo, brev)
5706
5713
5707 return ret
5714 return ret
@@ -109,7 +109,7 divergent bookmarks
109 * X 1:9b140be10808
109 * X 1:9b140be10808
110 Y 0:4e3505fd9583
110 Y 0:4e3505fd9583
111 foo -1:000000000000
111 foo -1:000000000000
112 foobar -1:000000000000
112 foobar 1:9b140be10808
113
113
114 $ hg pull --config paths.foo=../a foo
114 $ hg pull --config paths.foo=../a foo
115 pulling from $TESTTMP/a
115 pulling from $TESTTMP/a
@@ -125,7 +125,7 divergent bookmarks
125 X@foo 2:0d2164f0ce0d
125 X@foo 2:0d2164f0ce0d
126 Y 0:4e3505fd9583
126 Y 0:4e3505fd9583
127 foo -1:000000000000
127 foo -1:000000000000
128 foobar -1:000000000000
128 foobar 1:9b140be10808
129 $ hg push -f ../a
129 $ hg push -f ../a
130 pushing to ../a
130 pushing to ../a
131 searching for changes
131 searching for changes
@@ -158,7 +158,7 hgweb
158 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
158 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
159 X 9b140be1080824d768c5a4691a564088eede71f9
159 X 9b140be1080824d768c5a4691a564088eede71f9
160 foo 0000000000000000000000000000000000000000
160 foo 0000000000000000000000000000000000000000
161 foobar 0000000000000000000000000000000000000000
161 foobar 9b140be1080824d768c5a4691a564088eede71f9
162 $ hg out -B http://localhost:$HGPORT/
162 $ hg out -B http://localhost:$HGPORT/
163 comparing with http://localhost:$HGPORT/
163 comparing with http://localhost:$HGPORT/
164 searching for changed bookmarks
164 searching for changed bookmarks
@@ -174,7 +174,7 hgweb
174 searching for changed bookmarks
174 searching for changed bookmarks
175 Z 0d2164f0ce0d
175 Z 0d2164f0ce0d
176 foo 000000000000
176 foo 000000000000
177 foobar 000000000000
177 foobar 9b140be10808
178 $ hg pull -B Z http://localhost:$HGPORT/
178 $ hg pull -B Z http://localhost:$HGPORT/
179 pulling from http://localhost:$HGPORT/
179 pulling from http://localhost:$HGPORT/
180 no changes found
180 no changes found
@@ -193,6 +193,6 hgweb
193 Y 0:4e3505fd9583
193 Y 0:4e3505fd9583
194 Z 2:0d2164f0ce0d
194 Z 2:0d2164f0ce0d
195 foo -1:000000000000
195 foo -1:000000000000
196 foobar -1:000000000000
196 foobar 1:9b140be10808
197
197
198 $ kill `cat ../hg.pid`
198 $ kill `cat ../hg.pid`
General Comments 0
You need to be logged in to leave comments. Login now