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

mail settings
Submitter Mads Kiilerich
Date Jan. 12, 2013, 7:22 p.m.
Message ID <ac02f9c0f2ea45ab95e4.1358018569@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/573/
State Accepted
Commit cfa731b45b75073562dcf7223f48655fcd3ead6f
Headers show


Mads Kiilerich - Jan. 12, 2013, 7:22 p.m.
# HG changeset patch
# User Mads Kiilerich <>
# 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/ b/hgext/
--- a/hgext/
+++ b/hgext/
@@ -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