comparison hgext/rebase.py @ 27167:3fe8cb40c9c5

commands: inline definition of localrepo.parents() and drop the method (API) localrepo.parents() has relatively few users, and most of those were actually implicitly looking at the wctx, which is now made explicit via repo[None].
author Augie Fackler <augie@google.com>
date Wed, 11 Nov 2015 20:07:15 -0500
parents 88fde8db5307
children 40a2f972f26d
comparison
equal deleted inserted replaced
27166:263db31329a6 27167:3fe8cb40c9c5
439 _('changesets'), total) 439 _('changesets'), total)
440 p1, p2, base = defineparents(repo, rev, target, state, 440 p1, p2, base = defineparents(repo, rev, target, state,
441 targetancestors) 441 targetancestors)
442 storestatus(repo, originalwd, target, state, collapsef, keepf, 442 storestatus(repo, originalwd, target, state, collapsef, keepf,
443 keepbranchesf, external, activebookmark) 443 keepbranchesf, external, activebookmark)
444 if len(repo.parents()) == 2: 444 if len(repo[None].parents()) == 2:
445 repo.ui.debug('resuming interrupted rebase\n') 445 repo.ui.debug('resuming interrupted rebase\n')
446 else: 446 else:
447 try: 447 try:
448 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''), 448 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
449 'rebase') 449 'rebase')
928 collapse, keep, keepbranches, external, activebookmark) 928 collapse, keep, keepbranches, external, activebookmark)
929 929
930 def needupdate(repo, state): 930 def needupdate(repo, state):
931 '''check whether we should `update --clean` away from a merge, or if 931 '''check whether we should `update --clean` away from a merge, or if
932 somehow the working dir got forcibly updated, e.g. by older hg''' 932 somehow the working dir got forcibly updated, e.g. by older hg'''
933 parents = [p.rev() for p in repo.parents()] 933 parents = [p.rev() for p in repo[None].parents()]
934 934
935 # Are we in a merge state at all? 935 # Are we in a merge state at all?
936 if len(parents) < 2: 936 if len(parents) < 2:
937 return False 937 return False
938 938