changeset 4219:6cb5be6bd70f

mq: add qparent tag (first parent of qbase)
author Brendan Cully <brendan@kublai.com>
date Wed, 14 Mar 2007 10:45:18 -0700
parents dbc3846c09a1
children 1253703853a8
files hgext/mq.py tests/test-mq tests/test-mq.out
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Wed Mar 14 01:26:09 2007 -0500
+++ b/hgext/mq.py	Wed Mar 14 10:45:18 2007 -0700
@@ -2085,14 +2085,15 @@
             if not q.applied:
                 return tagscache
 
-            mqtags = [(patch.rev, patch.name) for patch in q.applied]
+            mqtags = [(revlog.bin(patch.rev), patch.name) for patch in q.applied]
             mqtags.append((mqtags[-1][0], 'qtip'))
             mqtags.append((mqtags[0][0], 'qbase'))
+            mqtags.append((self.changelog.parents(mqtags[0][0])[0], 'qparent'))
             for patch in mqtags:
                 if patch[1] in tagscache:
                     self.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1])
                 else:
-                    tagscache[patch[1]] = revlog.bin(patch[0])
+                    tagscache[patch[1]] = patch[0]
 
             return tagscache
 
--- a/tests/test-mq	Wed Mar 14 01:26:09 2007 -0500
+++ b/tests/test-mq	Wed Mar 14 10:45:18 2007 -0700
@@ -262,6 +262,9 @@
 hg qpush -a
 hg st
 
+echo % mq tags
+hg log --template '{rev} {tags}\n' -r qparent:qtip
+
 cat >>$HGRCPATH <<EOF
 [diff]
 git = True
--- a/tests/test-mq.out	Wed Mar 14 01:26:09 2007 -0500
+++ b/tests/test-mq.out	Wed Mar 14 10:45:18 2007 -0700
@@ -265,6 +265,10 @@
 Errors during apply, please fix and refresh bar
 ? foo
 ? foo.rej
+% mq tags
+0 qparent
+1 qbase foo
+2 qtip bar tip
 new file
 
 diff --git a/new b/new