comparison hgext/mq.py @ 2677:ec05ce9cbf47

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.
author "Mathieu Clabaut <mathieu.clabaut@gmail.com>"
date Wed, 26 Jul 2006 01:03:33 +0200
parents 9b8df8dceeed
children 4e2dc5c16e61
comparison
equal deleted inserted replaced
2676:7c81e337fed2 2677:ec05ce9cbf47
850 if not patch: 850 if not patch:
851 start = self.series_end() 851 start = self.series_end()
852 else: 852 else:
853 start = self.series.index(patch) + 1 853 start = self.series.index(patch) + 1
854 for p in self.series[start:]: 854 for p in self.series[start:]:
855 if self.ui.verbose:
856 self.ui.write("%d " % self.series.index(p))
855 self.ui.write("%s\n" % p) 857 self.ui.write("%s\n" % p)
856 858
857 def qseries(self, repo, missing=None): 859 def qseries(self, repo, missing=None):
858 start = self.series_end() 860 start = self.series_end()
859 if not missing: 861 if not missing:
997 p = self.appliedname(x) 999 p = self.appliedname(x)
998 self.ui.write("%s\n" % p) 1000 self.ui.write("%s\n" % p)
999 1001
1000 def appliedname(self, index): 1002 def appliedname(self, index):
1001 p = self.applied[index] 1003 p = self.applied[index]
1004 pname = p.split(':')[1]
1002 if not self.ui.verbose: 1005 if not self.ui.verbose:
1003 p = p.split(':')[1] 1006 p = pname
1007 else:
1008 p = str(self.series.index(pname)) + " " + p
1004 return p 1009 return p
1005 1010
1006 def top(self, repo): 1011 def top(self, repo):
1007 if len(self.applied): 1012 if len(self.applied):
1008 p = self.appliedname(-1) 1013 p = self.appliedname(-1)
1013 def next(self, repo): 1018 def next(self, repo):
1014 end = self.series_end() 1019 end = self.series_end()
1015 if end == len(self.series): 1020 if end == len(self.series):
1016 self.ui.write("All patches applied\n") 1021 self.ui.write("All patches applied\n")
1017 else: 1022 else:
1018 self.ui.write(self.series[end] + '\n') 1023 p = self.series[end]
1024 if self.ui.verbose:
1025 self.ui.write("%d " % self.series.index(p))
1026 self.ui.write(p + '\n')
1019 1027
1020 def prev(self, repo): 1028 def prev(self, repo):
1021 if len(self.applied) > 1: 1029 if len(self.applied) > 1:
1022 p = self.appliedname(-2) 1030 p = self.appliedname(-2)
1023 self.ui.write(p + '\n') 1031 self.ui.write(p + '\n')