[PATCH 5 of 9 standalone-strip] mq: document repo.mq.qparents

pierre-yves.david at ens-lyon.org pierre-yves.david at ens-lyon.org
Wed Sep 25 16:26:48 CDT 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1380130485 -7200
#      Wed Sep 25 19:34:45 2013 +0200
# Node ID afc02cb343a84c3d4cc170f14a434e82af1e1339
# Parent  99c7c15112d6d2a0b4cbf4a9f87de28f48ab566c
mq: document repo.mq.qparents

The function is not very complex but writing this doc helped me to check if
I got everything right.

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -626,10 +626,18 @@ class queue(object):
         patchf.close()
         self.removeundo(repo)
         return (0, n)
 
     def qparents(self, repo, rev=None):
+        """return the mq handled parent or p1
+
+        In some case where mq get himself in being the parent of a merge the
+        paappropriate parent may be p2.
+        (eg: an in progress merge started with mq disabled)
+
+        If no parent are managed by mq, p1 is returned.
+        """
         if rev is None:
             (p1, p2) = repo.dirstate.parents()
             if p2 == nullid:
                 return p1
             if not self.applied:


More information about the Mercurial-devel mailing list