changeset 308:23ef1c71d164

obsolete: detect late comer during push
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Mon, 25 Jun 2012 15:18:47 +0200
parents 9ac56d36d6ff
children de21685d22d1
files hgext/obsolete.py tests/test-obsolete.t
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/obsolete.py	Tue Jun 26 11:33:39 2012 +0200
+++ b/hgext/obsolete.py	Mon Jun 25 15:18:47 2012 +0200
@@ -468,6 +468,9 @@
         if ctx.obsolete():
             raise util.Abort(_("Trying to push obsolete changeset: %s!") % ctx,
                              hint=hint)
+        if ctx.latecomer():
+            raise util.Abort(_("Trying to push latecomer changeset: %s!") % ctx,
+                             hint=hint)
     ### patch remote branch map
     # do not read it this burn eyes
     try:
--- a/tests/test-obsolete.t	Tue Jun 26 11:33:39 2012 +0200
+++ b/tests/test-obsolete.t	Mon Jun 25 15:18:47 2012 +0200
@@ -509,3 +509,9 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add obsol_d'''
   
+  $ hg push ../other-new/
+  pushing to ../other-new/
+  searching for changes
+  abort: Trying to push latecomer changeset: 6db5e282cb91!
+  (use 'hg stabilize' to get a stable history (or --force to proceed))
+  [255]