[PATCH 2 of 2] mq: checktoppatch should only check if p1 is qtip

Mads Kiilerich mads at kiilerich.com
Sat Jan 12 13:22:49 CST 2013


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1358018220 -3600
# Node ID ac02f9c0f2ea45ab95e43196542dbb2f8f765469
# Parent  cb128d39bedffcee8b8f5db863cb0a05276bbb73
mq: checktoppatch should only check if p1 is qtip

There is no way qtip in p2 could be used for anything, and there is thus no
reason to check and accept it.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -929,11 +929,11 @@ class queue(object):
         self._cleanup(realpatches, numrevs, opts.get('keep'))
 
     def checktoppatch(self, repo):
+        '''check that working directory is at qtip'''
         if self.applied:
             top = self.applied[-1].node
             patch = self.applied[-1].name
-            pp = repo.dirstate.parents()
-            if top not in pp:
+            if repo.dirstate.p1() != top:
                 raise util.Abort(_("working directory revision is not qtip"))
             return top, patch
         return None, None


More information about the Mercurial-devel mailing list