comparison hgext/mq.py @ 2756:caa6d992608b

Add -s option to qseries: display first line of patch header.
author Brendan Cully <brendan@kublai.com>
date Tue, 01 Aug 2006 15:24:18 -0700
parents 19041b8cbc86
children 787e18b84893
comparison
equal deleted inserted replaced
2755:6c2c10cedf7a 2756:caa6d992608b
932 for p in self.series[start:]: 932 for p in self.series[start:]:
933 if self.ui.verbose: 933 if self.ui.verbose:
934 self.ui.write("%d " % self.series.index(p)) 934 self.ui.write("%d " % self.series.index(p))
935 self.ui.write("%s\n" % p) 935 self.ui.write("%s\n" % p)
936 936
937 def qseries(self, repo, missing=None): 937 def qseries(self, repo, missing=None, summary=False):
938 start = self.series_end() 938 start = self.series_end()
939 if not missing: 939 if not missing:
940 for p in self.series[:start]: 940 for i in range(len(self.series)):
941 patch = self.series[i]
941 if self.ui.verbose: 942 if self.ui.verbose:
942 self.ui.write("%d A " % self.series.index(p)) 943 if i < start:
943 self.ui.write("%s\n" % p) 944 status = 'A'
944 for p in self.series[start:]: 945 else:
945 if self.ui.verbose: 946 status = 'U'
946 self.ui.write("%d U " % self.series.index(p)) 947 self.ui.write('%d %s ' % (i, status))
947 self.ui.write("%s\n" % p) 948 if summary:
949 msg = self.readheaders(patch)[0]
950 msg = msg and ': ' + msg[0] or ': '
951 else:
952 msg = ''
953 self.ui.write('%s%s\n' % (patch, msg))
948 else: 954 else:
949 list = [] 955 list = []
950 for root, dirs, files in os.walk(self.path): 956 for root, dirs, files in os.walk(self.path):
951 d = root[len(self.path) + 1:] 957 d = root[len(self.path) + 1:]
952 for f in files: 958 for f in files:
1253 if not r: raise util.Abort('no queue repository') 1259 if not r: raise util.Abort('no queue repository')
1254 commands.commit(r.ui, r, *pats, **opts) 1260 commands.commit(r.ui, r, *pats, **opts)
1255 1261
1256 def series(ui, repo, **opts): 1262 def series(ui, repo, **opts):
1257 """print the entire series file""" 1263 """print the entire series file"""
1258 repo.mq.qseries(repo, missing=opts['missing']) 1264 repo.mq.qseries(repo, missing=opts['missing'], summary=opts['summary'])
1259 return 0 1265 return 0
1260 1266
1261 def top(ui, repo, **opts): 1267 def top(ui, repo, **opts):
1262 """print the name of the current patch""" 1268 """print the name of the current patch"""
1263 repo.mq.top(repo) 1269 repo.mq.top(repo)
1602 ('e', 'empty', None, 'clear queue status file'), 1608 ('e', 'empty', None, 'clear queue status file'),
1603 ('f', 'force', None, 'force copy')], 1609 ('f', 'force', None, 'force copy')],
1604 'hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]'), 1610 'hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]'),
1605 "qseries": 1611 "qseries":
1606 (series, 1612 (series,
1607 [('m', 'missing', None, 'print patches not in series')], 1613 [('m', 'missing', None, 'print patches not in series'),
1614 ('s', 'summary', None, _('print first line of patch header'))],
1608 'hg qseries [-m]'), 1615 'hg qseries [-m]'),
1609 "^strip": 1616 "^strip":
1610 (strip, 1617 (strip,
1611 [('f', 'force', None, 'force multi-head removal'), 1618 [('f', 'force', None, 'force multi-head removal'),
1612 ('b', 'backup', None, 'bundle unrelated changesets'), 1619 ('b', 'backup', None, 'bundle unrelated changesets'),