mq: uniform verbose display of patche[s].
author"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
Wed, 26 Jul 2006 01:03:33 +0200
changeset 2677 ec05ce9cbf47
parent 2676 7c81e337fed2
child 2678 a781df9b5faa
mq: uniform verbose display of patche[s]. In verbose mode, display: "index patchname" for unapplied patches "index cset:patchnames" for applied patches "index status patchname" in the serie listing.
hgext/mq.py
--- a/hgext/mq.py	Wed Jul 26 08:42:20 2006 +0200
+++ b/hgext/mq.py	Wed Jul 26 01:03:33 2006 +0200
@@ -852,6 +852,8 @@
         else:
             start = self.series.index(patch) + 1
         for p in self.series[start:]:
+            if self.ui.verbose:
+                self.ui.write("%d " % self.series.index(p))
             self.ui.write("%s\n" % p)
 
     def qseries(self, repo, missing=None):
@@ -999,8 +1001,11 @@
 
     def appliedname(self, index):
         p = self.applied[index]
+        pname = p.split(':')[1]
         if not self.ui.verbose:
-            p = p.split(':')[1]
+            p = pname
+        else:
+            p = str(self.series.index(pname)) + " " + p
         return p
 
     def top(self, repo):
@@ -1015,7 +1020,10 @@
         if end == len(self.series):
             self.ui.write("All patches applied\n")
         else:
-            self.ui.write(self.series[end] + '\n')
+            p = self.series[end]
+            if self.ui.verbose:
+                self.ui.write("%d " % self.series.index(p))
+            self.ui.write(p + '\n')
 
     def prev(self, repo):
         if len(self.applied) > 1: