##// END OF EJS Templates
commands: inline definition of localrepo.parents() and drop the method (API)...
Augie Fackler -
r27167:3fe8cb40 default
parent child Browse files
Show More
@@ -441,7 +441,7 b' def rebase(ui, repo, **opts):'
441 441 targetancestors)
442 442 storestatus(repo, originalwd, target, state, collapsef, keepf,
443 443 keepbranchesf, external, activebookmark)
444 if len(repo.parents()) == 2:
444 if len(repo[None].parents()) == 2:
445 445 repo.ui.debug('resuming interrupted rebase\n')
446 446 else:
447 447 try:
@@ -930,7 +930,7 b' def restorestatus(repo):'
930 930 def needupdate(repo, state):
931 931 '''check whether we should `update --clean` away from a merge, or if
932 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 935 # Are we in a merge state at all?
936 936 if len(parents) < 2:
@@ -1190,7 +1190,7 b' def branch(ui, repo, label=None, **opts)'
1190 1190 ui.status(_('reset working directory to branch %s\n') % label)
1191 1191 elif label:
1192 1192 if not opts.get('force') and label in repo.branchmap():
1193 if label not in [p.branch() for p in repo.parents()]:
1193 if label not in [p.branch() for p in repo[None].parents()]:
1194 1194 raise error.Abort(_('a branch of the same name already'
1195 1195 ' exists'),
1196 1196 # i18n: "it" refers to an existing branch
@@ -1600,8 +1600,8 b' def commit(ui, repo, *pats, **opts):'
1600 1600 if not bheads:
1601 1601 raise error.Abort(_('can only close branch heads'))
1602 1602 elif opts.get('amend'):
1603 if repo.parents()[0].p1().branch() != branch and \
1604 repo.parents()[0].p2().branch() != branch:
1603 if repo[None].parents()[0].p1().branch() != branch and \
1604 repo[None].parents()[0].p2().branch() != branch:
1605 1605 raise error.Abort(_('can only close branch heads'))
1606 1606
1607 1607 if opts.get('amend'):
@@ -4545,7 +4545,7 b' def import_(ui, repo, patch1=None, *patc'
4545 4545 tr = repo.transaction('import')
4546 4546 else:
4547 4547 dsguard = cmdutil.dirstateguard(repo, 'import')
4548 parents = repo.parents()
4548 parents = repo[None].parents()
4549 4549 for patchurl in patches:
4550 4550 if patchurl == '-':
4551 4551 ui.status(_('applying patch from stdin\n'))
@@ -4565,7 +4565,7 b' def import_(ui, repo, patch1=None, *patc'
4565 4565 haspatch = True
4566 4566 ui.note(msg + '\n')
4567 4567 if update or opts.get('exact'):
4568 parents = repo.parents()
4568 parents = repo[None].parents()
4569 4569 else:
4570 4570 parents = [repo[node]]
4571 4571 if rej:
@@ -852,10 +852,6 b' class localrepository(object):'
852 852 def changectx(self, changeid):
853 853 return self[changeid]
854 854
855 def parents(self, changeid=None):
856 '''get list of changectxs for parents of changeid'''
857 return self[changeid].parents()
858
859 855 def setparents(self, p1, p2=nullid):
860 856 self.dirstate.beginparentchange()
861 857 copies = self.dirstate.setparents(p1, p2)
@@ -1170,7 +1166,7 b' class localrepository(object):'
1170 1166 % self.dirstate.branch())
1171 1167
1172 1168 self.dirstate.invalidate()
1173 parents = tuple([p.rev() for p in self.parents()])
1169 parents = tuple([p.rev() for p in self[None].parents()])
1174 1170 if len(parents) > 1:
1175 1171 ui.status(_('working directory now based on '
1176 1172 'revisions %d and %d\n') % parents)
General Comments 0
You need to be logged in to leave comments. Login now