changeset 3768:6ae3685be45d

merge with crew
author Thomas Arendsen Hein <thomas@intevation.de>
date Sat, 02 Dec 2006 22:41:05 +0100
parents 1861fa38a6a7 (current diff) 955475d237fc (diff)
children 96095d9ff1f8 8ecc9c57d883
files
diffstat 3 files changed, 27 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Sat Dec 02 22:35:17 2006 +0100
+++ b/hgext/mq.py	Sat Dec 02 22:41:05 2006 +0100
@@ -1124,21 +1124,21 @@
             else:
                 return self.series[i]
 
-        unapplied = self.series_end(all_patches=True)
+        applied = dict.fromkeys([p.name for p in self.applied])
         if not length:
             length = len(self.series) - start
         if not missing:
             for i in xrange(start, start+length):
                 pfx = ''
+                patch = pname(i)
                 if self.ui.verbose:
-                    if i < unapplied:
-                        status = 'A'
+                    if patch in applied:
+                        stat = 'A'
                     elif self.pushable(i)[0]:
-                        status = 'U'
+                        stat = 'U'
                     else:
-                        status = 'G'
-                    pfx = '%d %s ' % (i, status)
-                patch = pname(i)
+                        stat = 'G'
+                    pfx = '%d %s ' % (i, stat)
                 self.ui.write('%s%s\n' % (pfx, displayname(patch)))
         else:
             msng_list = []
--- a/tests/test-mq-guards	Sat Dec 02 22:35:17 2006 +0100
+++ b/tests/test-mq-guards	Sat Dec 02 22:41:05 2006 +0100
@@ -106,4 +106,12 @@
 echo % c.patch: unguarded
 hg qguard -l
 
+hg qnew d.patch
+hg qpop
+echo % should show new.patch and b.patch as Guarded, c.patch as Applied
+echo % and d.patch as Unapplied
+hg qseries -v
 
+hg qguard d.patch +2
+echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
+hg qseries -v
--- a/tests/test-mq-guards.out	Sat Dec 02 22:35:17 2006 +0100
+++ b/tests/test-mq-guards.out	Sat Dec 02 22:41:05 2006 +0100
@@ -89,3 +89,15 @@
 new.patch: +1 +2 -3
 b.patch: +2
 c.patch: unguarded
+Now at: c.patch
+% should show new.patch and b.patch as Guarded, c.patch as Applied
+% and d.patch as Unapplied
+0 G new.patch
+1 G b.patch
+2 A c.patch
+3 U d.patch
+% new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
+0 G new.patch
+1 G b.patch
+2 A c.patch
+3 G d.patch