##// END OF EJS Templates
fix push of moved bookmark when creating new branch heads...
Sune Foldager -
r17043:6f89c3f0 default
parent child Browse files
Show More
@@ -225,7 +225,6 b' def checkheads(repo, remote, outgoing, r'
225 # If there are more heads after the push than before, a suitable
225 # If there are more heads after the push than before, a suitable
226 # error message, depending on unsynced status, is displayed.
226 # error message, depending on unsynced status, is displayed.
227 error = None
227 error = None
228 remotebookmarks = remote.listkeys('bookmarks')
229 localbookmarks = repo._bookmarks
228 localbookmarks = repo._bookmarks
230
229
231 for branch in branches:
230 for branch in branches:
@@ -234,9 +233,14 b' def checkheads(repo, remote, outgoing, r'
234 dhs = None
233 dhs = None
235 if len(newhs) > len(oldhs):
234 if len(newhs) > len(oldhs):
236 # strip updates to existing remote heads from the new heads list
235 # strip updates to existing remote heads from the new heads list
237 bookmarkedheads = set([repo[bm].node() for bm in localbookmarks
236 remotebookmarks = remote.listkeys('bookmarks')
238 if bm in remotebookmarks and
237 bookmarkedheads = set()
239 remote[bm] == repo[bm].ancestor(remote[bm])])
238 for bm in localbookmarks:
239 rnode = remotebookmarks.get(bm)
240 if rnode and rnode in repo:
241 lctx, rctx = repo[bm], repo[rnode]
242 if rctx == lctx.ancestor(rctx):
243 bookmarkedheads.add(lctx.node())
240 dhs = list(newhs - bookmarkedheads - oldhs)
244 dhs = list(newhs - bookmarkedheads - oldhs)
241 if dhs:
245 if dhs:
242 if error is None:
246 if error is None:
@@ -177,8 +177,18 b' diverging a remote bookmark fails'
177 adding f2
177 adding f2
178 created new head
178 created new head
179 $ hg book -f Y
179 $ hg book -f Y
180 $ hg push ../a
180
181 pushing to ../a
181 $ cat <<EOF > ../a/.hg/hgrc
182 > [web]
183 > push_ssl = false
184 > allow_push = *
185 > EOF
186
187 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
188 $ cat ../hg2.pid >> $DAEMON_PIDS
189
190 $ hg push http://localhost:$HGPORT2/
191 pushing to http://localhost:$HGPORT2/
182 searching for changes
192 searching for changes
183 abort: push creates new remote head 4efff6d98829!
193 abort: push creates new remote head 4efff6d98829!
184 (did you forget to merge? use push -f to force)
194 (did you forget to merge? use push -f to force)
General Comments 0
You need to be logged in to leave comments. Login now