Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHG2b38c80557a4: destutil: look up bookmarks only among bookmarks
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/destutil.py (6 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
return node, movemark, None | return node, movemark, None | ||||
def _destupdatebook(repo, clean): | def _destupdatebook(repo, clean): | ||||
"""decide on an update destination from active bookmark""" | """decide on an update destination from active bookmark""" | ||||
# we also move the active bookmark, if any | # we also move the active bookmark, if any | ||||
node = None | node = None | ||||
activemark, movemark = bookmarks.calculateupdate(repo.ui, repo) | activemark, movemark = bookmarks.calculateupdate(repo.ui, repo) | ||||
if activemark is not None: | if activemark is not None: | ||||
node = repo.lookup(activemark) | node = repo._bookmarks[activemark] | ||||
return node, movemark, activemark | return node, movemark, activemark | ||||
def _destupdatebranch(repo, clean): | def _destupdatebranch(repo, clean): | ||||
"""decide on an update destination from current branch | """decide on an update destination from current branch | ||||
This ignores closed branch heads. | This ignores closed branch heads. | ||||
""" | """ | ||||
wc = repo[None] | wc = repo[None] | ||||
_('specify an explicit destination with --dest')), | _('specify an explicit destination with --dest')), | ||||
}, | }, | ||||
} | } | ||||
def _destmergebook(repo, action='merge', sourceset=None, destspace=None): | def _destmergebook(repo, action='merge', sourceset=None, destspace=None): | ||||
"""find merge destination in the active bookmark case""" | """find merge destination in the active bookmark case""" | ||||
node = None | node = None | ||||
bmheads = bookmarks.headsforactive(repo) | bmheads = bookmarks.headsforactive(repo) | ||||
curhead = repo[repo._activebookmark].node() | curhead = repo._bookmarks[repo._activebookmark] | ||||
if len(bmheads) == 2: | if len(bmheads) == 2: | ||||
if curhead == bmheads[0]: | if curhead == bmheads[0]: | ||||
node = bmheads[1] | node = bmheads[1] | ||||
else: | else: | ||||
node = bmheads[0] | node = bmheads[0] | ||||
elif len(bmheads) > 2: | elif len(bmheads) > 2: | ||||
msg, hint = msgdestmerge['toomanybookmarks'][action] | msg, hint = msgdestmerge['toomanybookmarks'][action] | ||||
raise error.ManyMergeDestAbort(msg, hint=hint) | raise error.ManyMergeDestAbort(msg, hint=hint) | ||||
return None | return None | ||||
def stackbase(ui, repo): | def stackbase(ui, repo): | ||||
revs = stack.getstack(repo) | revs = stack.getstack(repo) | ||||
return revs.first() if revs else None | return revs.first() if revs else None | ||||
def _statusotherbook(ui, repo): | def _statusotherbook(ui, repo): | ||||
bmheads = bookmarks.headsforactive(repo) | bmheads = bookmarks.headsforactive(repo) | ||||
curhead = repo[repo._activebookmark].node() | curhead = repo._bookmarks[repo._activebookmark] | ||||
if repo.revs('%n and parents()', curhead): | if repo.revs('%n and parents()', curhead): | ||||
# we are on the active bookmark | # we are on the active bookmark | ||||
bmheads = [b for b in bmheads if curhead != b] | bmheads = [b for b in bmheads if curhead != b] | ||||
if bmheads: | if bmheads: | ||||
msg = _('%i other divergent bookmarks for "%s"\n') | msg = _('%i other divergent bookmarks for "%s"\n') | ||||
ui.status(msg % (len(bmheads), repo._activebookmark)) | ui.status(msg % (len(bmheads), repo._activebookmark)) | ||||
def _statusotherbranchheads(ui, repo): | def _statusotherbranchheads(ui, repo): |