hgext/evolve.py
branchstable
changeset 1157 5951969400ce
parent 1153 4241a5162de7
child 1159 04bd66779a1f
child 1160 e29a813f6af5
equal deleted inserted replaced
1156:0f53c24096c6 1157:5951969400ce
  1189                 ui.status(_('update:'))
  1189                 ui.status(_('update:'))
  1190                 if not ui.quiet:
  1190                 if not ui.quiet:
  1191                     displayer.show(ctx)
  1191                     displayer.show(ctx)
  1192 
  1192 
  1193                 if dryrunopt:
  1193                 if dryrunopt:
  1194                     print 'hg update %s' % ctx.rev()
       
  1195                     return 0
  1194                     return 0
  1196                 else:
  1195                 else:
  1197                     res = hg.update(repo, ctx.rev())
  1196                     res = hg.update(repo, ctx.rev())
  1198                     if ctx != startnode:
  1197                     if ctx != startnode:
  1199                         ui.status(_('working directory is now at %s\n') % ctx)
  1198                         ui.status(_('working directory is now at %s\n') % ctx)
  1301             for prec in repo.set('allprecursors(%d)', ctx):
  1300             for prec in repo.set('allprecursors(%d)', ctx):
  1302                 yield prec
  1301                 yield prec
  1303 
  1302 
  1304     # Look for an unstable which can be stabilized as a child of
  1303     # Look for an unstable which can be stabilized as a child of
  1305     # node. The unstable must be a child of one of node predecessors.
  1304     # node. The unstable must be a child of one of node predecessors.
       
  1305     directdesc = set([pctx.rev()])
  1306     for ctx in selfanddescendants(repo, pctx):
  1306     for ctx in selfanddescendants(repo, pctx):
  1307         for child in ctx.children():
  1307         for child in ctx.children():
  1308             if child.unstable():
  1308             if ctx.rev() in directdesc and not child.obsolete():
       
  1309                 directdesc.add(child.rev())
       
  1310             elif child.unstable():
  1309                 return child
  1311                 return child
  1310     return None
  1312     return None
  1311 
  1313 
  1312 def _solveunstable(ui, repo, orig, dryrun=False, confirm=False,
  1314 def _solveunstable(ui, repo, orig, dryrun=False, confirm=False,
  1313                    progresscb=None):
  1315                    progresscb=None):
  1314     """Stabilize a unstable changeset"""
  1316     """Stabilize a unstable changeset"""
  1315     obs = orig.parents()[0]
  1317     obs = orig.parents()[0]
  1316     if not obs.obsolete():
  1318     if not obs.obsolete():
  1317         print obs.rev(), orig.parents()
  1319         obs = orig.parents()[1] # second parent is obsolete ?
  1318         print orig.rev()
       
  1319         obs = orig.parents()[1]
       
  1320     assert obs.obsolete()
  1320     assert obs.obsolete()
  1321     newer = obsolete.successorssets(repo, obs.node())
  1321     newer = obsolete.successorssets(repo, obs.node())
  1322     # search of a parent which is not killed
  1322     # search of a parent which is not killed
  1323     while not newer or newer == [()]:
  1323     while not newer or newer == [()]:
  1324         ui.debug("stabilize target %s is plain dead,"
  1324         ui.debug("stabilize target %s is plain dead,"