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

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 25, 2013, 9:26 p.m.
Message ID <afc02cb343a84c3d4cc1.1380144408@vulgaris>
Download mbox | patch
Permalink /patch/2634/
State Accepted
Commit d5ec50e8604b200497c8c24ee741425663221da5
Headers show

Comments

Pierre-Yves David - Sept. 25, 2013, 9:26 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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: