Commits

Pierre-Yves David committed de21685

evolve: warn when latecomer changeset are created

  • Participants
  • Parent commits 23ef1c7
  • Branches default

Comments (0)

Files changed (2)

File hgext/evolve.py

     return map(repo.changelog.node,
                scmutil.revrange(repo, revsets))
 
-def warnunstable(orig, ui, repo, *args, **kwargs):
+def warnobserrors(orig, ui, repo, *args, **kwargs):
     """display warning is the command resulted in more instable changeset"""
     priorunstables = len(repo.revs('unstable()'))
+    priorlatecomers = len(repo.revs('latecomer()'))
     #print orig, priorunstables
     #print len(repo.revs('secret() - obsolete()'))
     try:
         return orig(ui, repo, *args, **kwargs)
     finally:
         newunstables = len(repo.revs('unstable()')) - priorunstables
+        newlatecomers = len(repo.revs('latecomer()')) - priorlatecomers
         #print orig, newunstables
         #print len(repo.revs('secret() - obsolete()'))
         if newunstables > 0:
             ui.warn(_('%i new unstables changesets\n') % newunstables)
+        if newlatecomers > 0:
+            ui.warn(_('%i new latecomers changesets\n') % newlatecomers)
 
 ### changeset rewriting logic
 #############################
                      _("make graft obsoletes its source")))
 
     # warning about more obsolete
-    for cmd in ['commit', 'push', 'pull', 'graft']:
-        entry = extensions.wrapcommand(commands.table, cmd, warnunstable)
+    for cmd in ['commit', 'push', 'pull', 'graft', 'phase', 'unbundle']:
+        entry = extensions.wrapcommand(commands.table, cmd, warnobserrors)
     for cmd in ['kill', 'amend']:
-        entry = extensions.wrapcommand(cmdtable, cmd, warnunstable)
+        entry = extensions.wrapcommand(cmdtable, cmd, warnobserrors)
 
     if rebase is not None:
-        entry = extensions.wrapcommand(rebase.cmdtable, 'rebase', warnunstable)
+        entry = extensions.wrapcommand(rebase.cmdtable, 'rebase', warnobserrors)

File tests/test-evolve.t

   8	feature-B: another feature that rox - test
   6	feature-A: a nifty feature - test
   0	: base - test
+
+phase change turning obsolete changeset public issue a latecomer warning
+
+  $ hg phase --public 7
+  1 new latecomers changesets
+
   $ cd ..
 
 enable general delta