comparison mercurial/commands.py @ 17264:ec7b9bec19c9 stable

strip: move bookmarks to nearest ancestor rather than '.' If you've got this graph: 0-1-2 \ 3 and 3 is checked out, 2 is bookmarked with "broken", and you do "hg strip 2", the bookmark will move to 3, not 1. That's always struck me as a bug. This change makes bookmarks move to the tipmost ancestor of the stripped set rather than the currently-checked-out revision, which is what I always expected should happen.
author Augie Fackler <raf@durin42.com>
date Thu, 26 Jul 2012 16:57:50 -0500
parents e432fb4b4221
children 4e35dea77e31
comparison
equal deleted inserted replaced
17263:c4ebdc36c17e 17264:ec7b9bec19c9
1296 opts.get('date') or old.date(), 1296 opts.get('date') or old.date(),
1297 match, 1297 match,
1298 editor=editor, 1298 editor=editor,
1299 extra=extra) 1299 extra=extra)
1300 1300
1301 current = repo._bookmarkcurrent
1302 marks = old.bookmarks()
1301 node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts) 1303 node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts)
1302 if node == old.node(): 1304 if node == old.node():
1303 ui.status(_("nothing changed\n")) 1305 ui.status(_("nothing changed\n"))
1304 return 1 1306 return 1
1307 elif marks:
1308 ui.debug('moving bookmarks %r from %s to %s\n' %
1309 (marks, old.hex(), hex(node)))
1310 for bm in marks:
1311 repo._bookmarks[bm] = node
1312 if bm == current:
1313 bookmarks.setcurrent(repo, bm)
1314 bookmarks.write(repo)
1305 else: 1315 else:
1306 e = cmdutil.commiteditor 1316 e = cmdutil.commiteditor
1307 if opts.get('force_editor'): 1317 if opts.get('force_editor'):
1308 e = cmdutil.commitforceeditor 1318 e = cmdutil.commitforceeditor
1309 1319