Commit baec8a5a authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

cleanup: replace .parents()[0] by .p1()

parent f1e90ce1d372
......@@ -949,7 +949,7 @@ def _prevupdate(repo, displayer, target, bookmark, dryrun, mergeopt):
def _findprevtarget(repo, displayer, movebookmark=False, topic=True):
target = bookmark = None
wkctx = repo[None]
p1 = wkctx.parents()[0]
p1 = wkctx.p1()
parents = p1.parents()
currenttopic = _getcurrenttopic(repo)
......
......@@ -1097,7 +1097,7 @@ def cmdprune(ui, repo, *revs, **opts):
newnode = wdp
while newnode in precs or newnode.obsolete():
newnode = newnode.parents()[0]
newnode = newnode.p1()
else:
# no need to update anywhere as wdp is not related to revs
# being pruned
......
......@@ -128,7 +128,7 @@ def _solveunstable(ui, repo, orig, evolvestate, displayer, dryrun=False,
ui.debug(b"stabilize target %s is plain dead,"
b" trying to stabilize on its parent\n" %
obs)
obs = obs.parents()[0]
obs = obs.p1()
newer = obsutil.successorssets(repo, obs.node())
if len(newer) > 1:
msg = _(b"skipping %s: divergent rewriting. can't choose "
......@@ -2167,7 +2167,7 @@ def _completerelocation(ui, repo, evolvestate):
ctxparents = orig.parents()
if len(ctxparents) == 2:
currentp1 = repo.dirstate.parents()[0]
currentp1 = repo.dirstate.p1()
p1obs = ctxparents[0].obsolete()
p2obs = ctxparents[1].obsolete()
# asumming that the parent of current wdir is successor of one
......@@ -2197,7 +2197,7 @@ def _completerelocation(ui, repo, evolvestate):
pass
else:
with repo.dirstate.parentchange():
repo.dirstate.setparents(repo.dirstate.parents()[0], nodemod.nullid)
repo.dirstate.setparents(repo.dirstate.p1(), nodemod.nullid)
with repo.ui.configoverride(overrides, b'evolve-continue'):
node = repo.commit(text=message, user=user,
......
......@@ -116,7 +116,7 @@ def _singlesuccessor(repo, p):
ui.debug(b"stabilize target %s is plain dead,"
b" trying to stabilize on its parent\n" %
obs)
obs = obs.parents()[0]
obs = obs.p1()
newer = obsutil.successorssets(repo, obs.node())
if len(newer) > 1 or len(newer[0]) > 1:
raise MultipleSuccessorsError(newer)
......
......@@ -81,7 +81,7 @@ def _singlesuccessor(repo, p):
ui.debug(b"stabilize target %s is plain dead,"
b" trying to stabilize on its parent\n" %
obs)
obs = obs.parents()[0]
obs = obs.p1()
newer = obsutil.successorssets(repo, obs.node())
if 1 < len(newer):
# divergence case
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment