--- 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