changeset 950:cf4dcf49d998

merge with stable
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 31 May 2014 00:23:25 -0700
parents b71b563b17de (current diff) 2b2a4ab0eb68 (diff)
children e3f7258d05d5
files hgext/evolve.py tests/test-evolve.t tests/test-stabilize-result.t
diffstat 3 files changed, 51 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Tue May 20 13:45:52 2014 -0700
+++ b/hgext/evolve.py	Sat May 31 00:23:25 2014 -0700
@@ -409,9 +409,11 @@
     if ui.config('alias', 'olog', None) is None:
         ui.setconfig('alias', 'olog', "log -r 'precursors(.)' --hidden")
     if ui.config('alias', 'odiff', None) is None:
-        ui.setconfig('alias', 'odiff', "diff --hidden --rev 'limit(precursors(.),1)' --rev .")
+        ui.setconfig('alias', 'odiff',
+            "diff --hidden --rev 'limit(precursors(.),1)' --rev .")
     if ui.config('alias', 'grab', None) is None:
-        ui.setconfig('alias', 'grab', "! $HG rebase --dest . --rev $@ && $HG up tip")
+        ui.setconfig('alias', 'grab',
+            "! $HG rebase --dest . --rev $@ && $HG up tip")
 
 
 ### Troubled revset symbol
@@ -617,9 +619,12 @@
     # workaround phase stupidity
     #phases._filterunknown(ui, repo.changelog, repo._phasecache.phaseroots)
     filtered = repo.changelog.filteredrevs
-    newunstables = len(set(getrevs(repo, 'unstable')) - filtered) - priorunstables
-    newbumpeds = len(set(getrevs(repo, 'bumped')) - filtered) - priorbumpeds
-    newdivergents = len(set(getrevs(repo, 'divergent')) - filtered) - priordivergents
+    newunstables = \
+        len(set(getrevs(repo, 'unstable')) - filtered) - priorunstables
+    newbumpeds = \
+        len(set(getrevs(repo, 'bumped')) - filtered) - priorbumpeds
+    newdivergents = \
+        len(set(getrevs(repo, 'divergent')) - filtered) - priordivergents
     if newunstables > 0:
         ui.warn(_('%i new unstable changesets\n') % newunstables)
     if newbumpeds > 0:
@@ -791,16 +796,17 @@
     """rewrite <rev> on dest"""
     try:
         if orig.rev() == dest.rev():
-            raise util.Abort(_('tried to relocade a node on top of itself'),
+            raise util.Abort(_('tried to relocate a node on top of itself'),
                              hint=_("This shouldn't happen. If you still "
                                     "need to move changesets, please do so "
-                                    "manually with nothing to rebase - working directory parent is also destination"))
+                                    "manually with nothing to rebase - working "
+                                    "directory parent is also destination"))
 
         rebase = extensions.find('rebase')
         # dummy state to trick rebase node
         if not orig.p2().rev() == node.nullrev:
             raise util.Abort(
-                'no support for evolution merge changesets yet',
+                'no support for evolving merge changesets yet',
                 hint="Redo the merge a use `hg prune` to obsolete the old one")
         destbookmarks = repo.nodebookmarks(dest.node())
         nodesrc = orig.node()
@@ -1106,7 +1112,8 @@
         ui.write('        mean length:        %9i\n' % mean)
 
 @command('^evolve|stabilize|solve',
-    [('n', 'dry-run', False, 'do not perform actions, just print what would be done'),
+    [('n', 'dry-run', False,
+        'do not perform actions, just print what would be done'),
     ('A', 'any', False, 'evolve any troubled changeset'),
     ('a', 'all', False, 'evolve all troubled changesets'),
     ('c', 'continue', False, 'continue an interrupted evolution'), ],
@@ -1142,16 +1149,17 @@
 
     if contopt:
         if anyopt:
-            raise util.Abort('can not specify both "--any" and "--continue"')
+            raise util.Abort('cannot specify both "--any" and "--continue"')
         if allopt:
-            raise util.Abort('can not specify both "--all" and "--continue"')
+            raise util.Abort('cannot specify both "--all" and "--continue"')
         graftcmd = commands.table['graft'][0]
         return graftcmd(ui, repo, old_obsolete=True, **{'continue': True})
 
     tr = _picknexttroubled(ui, repo, anyopt or allopt)
     if tr is None:
         if repo['.'].obsolete():
-            displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
+            displayer = cmdutil.show_changeset(
+                ui, repo, {'template': shorttemplate})
             successors = set()
 
             for successorsset in obsolete.successorssets(repo, repo['.'].node()):
@@ -1323,7 +1331,8 @@
         except MergeFailure:
             repo.opener.write('graftstate', orig.hex() + '\n')
             repo.ui.write_err(_('evolve failed!\n'))
-            repo.ui.write_err(_('fix conflict and run "hg evolve --continue"\n'))
+            repo.ui.write_err(
+                _('fix conflict and run "hg evolve --continue"\n'))
             raise
         finally:
             lock.release()
@@ -1367,7 +1376,8 @@
             try:
                 if not list(repo.set('parents(%d) and parents(%d)', bumped, prec)):
                     # Need to rebase the changeset at the right place
-                    repo.ui.status(_('rebasing to destination parent: %s\n') % prec.p1())
+                    repo.ui.status(
+                        _('rebasing to destination parent: %s\n') % prec.p1())
                     try:
                         tmpid = relocate(repo, bumped, prec.p1())
                         if tmpid is not None:
@@ -1376,7 +1386,8 @@
                     except MergeFailure:
                         repo.opener.write('graftstate', bumped.hex() + '\n')
                         repo.ui.write_err(_('evolution failed!\n'))
-                        repo.ui.write_err(_('fix conflict and run "hg evolve --continue"\n'))
+                        repo.ui.write_err(
+                            _('fix conflict and run "hg evolve --continue"\n'))
                         raise
                 # Create the new commit context
                 repo.ui.status(_('computing new diff\n'))
@@ -1421,7 +1432,7 @@
                                            flag=obsolete.bumpedfix)
                 bmupdate(newid)
                 tr.close()
-                repo.ui.status(_('commited as %s\n') % node.short(newid))
+                repo.ui.status(_('committed as %s\n') % node.short(newid))
             finally:
                 tr.release()
         finally:
@@ -1438,32 +1449,33 @@
         hint = ("changeset %d is divergent with a changeset that got splitted "
                 "| into multiple ones:\n[%s]\n"
                 "| This is not handled by automatic evolution yet\n"
-                "| You have to fallback to manual handling with commands as:\n"
+                "| You have to fallback to manual handling with commands "
+                "such as:\n"
                 "| - hg touch -D\n"
                 "| - hg prune\n"
                 "| \n"
                 "| You should contact your local evolution Guru for help.\n"
                 % (divergent, othersstr))
-        raise util.Abort("We do not handle divergence with split yet",
+        raise util.Abort("we do not handle divergence with split yet",
                          hint='')
     other = others[0]
     if divergent.phase() <= phases.public:
-        raise util.Abort("We can't resolve this conflict from the public side",
-                         hint="%s is public, try from %s" % (divergent, other))
+        raise util.Abort("we can't resolve this conflict from the public side",
+                    hint="%s is public, try from %s" % (divergent, other))
     if len(other.parents()) > 1:
         raise util.Abort("divergent changeset can't be a merge (yet)",
-                          hint="You have to fallback to solving this by hand...\n"
-                               "| This probably mean to redo the merge and use "
-                               "| `hg prune` to kill older version.")
+                    hint="You have to fallback to solving this by hand...\n"
+                         "| This probably means redoing the merge and using "
+                         "| `hg prune` to kill older version.")
     if other.p1() not in divergent.parents():
         raise util.Abort("parents are not common (not handled yet)",
-                         hint="| %(d)s, %(o)s are not based on the same changeset."
-                              "| With the current state of its implementation, "
-                              "| evolve does not work in that case.\n"
-                              "| rebase one of them next to the other and run "
-                              "| this command again.\n"
-                              "| - either: hg rebase -dest 'p1(%(d)s)' -r %(o)s"
-                              "| - or:     hg rebase -dest 'p1(%(d)s)' -r %(o)s"
+                    hint="| %(d)s, %(o)s are not based on the same changeset."
+                         "| With the current state of its implementation, "
+                         "| evolve does not work in that case.\n"
+                         "| rebase one of them next to the other and run "
+                         "| this command again.\n"
+                         "| - either: hg rebase -dest 'p1(%(d)s)' -r %(o)s"
+                         "| - or:     hg rebase -dest 'p1(%(d)s)' -r %(o)s"
                               % {'d': divergent, 'o': other})
 
     displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
@@ -1507,7 +1519,8 @@
             repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
                              "or 'hg update -C .' to abandon\n"))
         if stats[3] > 0:
-            raise util.Abort('Merge conflict between several amendments, and this is not yet automated',
+            raise util.Abort('merge conflict between several amendments '
+                '(this is not automated yet)',
                 hint="""/!\ You can try:
 /!\ * manual merge + resolve => new cset X
 /!\ * hg up to the parent of the amended changeset (which are named W and Z)
@@ -1611,7 +1624,8 @@
     else:
         for c in children:
             displayer.show(c)
-        ui.warn(_('multiple non-obsolete children, explicitly update to one\n'))
+        ui.warn(_('multiple non-obsolete children, '
+            'explicitly update to one of them\n'))
         return 1
 
 def _reachablefrombookmark(repo, revs, mark):
@@ -1724,7 +1738,8 @@
             raise util.Abort(msg)
 
         if biject and len(sucs) != len(precs):
-            msg = "Can't use %d successors for %d precursors" % (len(sucs), len(precs))
+            msg = "Can't use %d successors for %d precursors" \
+                % (len(sucs), len(precs))
             raise util.Abort(msg)
 
         relations = [(p, sucs) for p in precs]
--- a/tests/test-evolve.t	Tue May 20 13:45:52 2014 -0700
+++ b/tests/test-evolve.t	Sat May 31 00:23:25 2014 -0700
@@ -310,7 +310,7 @@
   recreate:[8] another feature that rox
   atop:[7] another feature
   computing new diff
-  commited as ca3b75e3e59b
+  committed as ca3b75e3e59b
   $ hg glog
   @  9	feature-B: bumped update to abe98aeaaa35: - test
   |
--- a/tests/test-stabilize-result.t	Tue May 20 13:45:52 2014 -0700
+++ b/tests/test-stabilize-result.t	Sat May 31 00:23:25 2014 -0700
@@ -160,7 +160,7 @@
   atop:[8] newer a
   rebasing to destination parent: 66719795a494
   computing new diff
-  commited as (a7cabd7bd9c2|671b9d7eeaec) (re)
+  committed as (a7cabd7bd9c2|671b9d7eeaec) (re)
   $ glog
   @  14:(a7cabd7bd9c2|671b9d7eeaec)@default\(draft\) bk:\[\] bumped update to 1cf0aacfd363: (re)
   |
@@ -321,7 +321,7 @@
   merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
   use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
-  abort: Merge conflict between several amendments, and this is not yet automated
+  abort: merge conflict between several amendments (this is not automated yet)
   (/!\ You can try:
   /!\ * manual merge + resolve => new cset X
   /!\ * hg up to the parent of the amended changeset (which are named W and Z)