##// END OF EJS Templates
qseries: make use of output labeling
Brodie Rao -
r10824:18def0d5 default
parent child Browse files
Show More
@@ -1416,7 +1416,7 b' class queue(object):'
1416
1416
1417 def qseries(self, repo, missing=None, start=0, length=None, status=None,
1417 def qseries(self, repo, missing=None, start=0, length=None, status=None,
1418 summary=False):
1418 summary=False):
1419 def displayname(pfx, patchname):
1419 def displayname(pfx, patchname, state):
1420 if summary:
1420 if summary:
1421 ph = patchheader(self.join(patchname), self.plainmode)
1421 ph = patchheader(self.join(patchname), self.plainmode)
1422 msg = ph.message and ph.message[0] or ''
1422 msg = ph.message and ph.message[0] or ''
@@ -1429,7 +1429,7 b' class queue(object):'
1429 msg = "%s%s: %s" % (pfx, patchname, msg)
1429 msg = "%s%s: %s" % (pfx, patchname, msg)
1430 else:
1430 else:
1431 msg = pfx + patchname
1431 msg = pfx + patchname
1432 self.ui.write(msg + '\n')
1432 self.ui.write(msg + '\n', label='qseries.' + state)
1433
1433
1434 applied = set([p.name for p in self.applied])
1434 applied = set([p.name for p in self.applied])
1435 if length is None:
1435 if length is None:
@@ -1440,17 +1440,17 b' class queue(object):'
1440 for i in xrange(start, start + length):
1440 for i in xrange(start, start + length):
1441 patch = self.series[i]
1441 patch = self.series[i]
1442 if patch in applied:
1442 if patch in applied:
1443 stat = 'A'
1443 char, state = 'A', 'applied'
1444 elif self.pushable(i)[0]:
1444 elif self.pushable(i)[0]:
1445 stat = 'U'
1445 char, state = 'U', 'unapplied'
1446 else:
1446 else:
1447 stat = 'G'
1447 char, state = 'G', 'guarded'
1448 pfx = ''
1448 pfx = ''
1449 if self.ui.verbose:
1449 if self.ui.verbose:
1450 pfx = '%*d %s ' % (idxwidth, i, stat)
1450 pfx = '%*d %s ' % (idxwidth, i, char)
1451 elif status and status != stat:
1451 elif status and status != char:
1452 continue
1452 continue
1453 displayname(pfx, patch)
1453 displayname(pfx, patch, state)
1454 else:
1454 else:
1455 msng_list = []
1455 msng_list = []
1456 for root, dirs, files in os.walk(self.path):
1456 for root, dirs, files in os.walk(self.path):
@@ -1464,7 +1464,7 b' class queue(object):'
1464 msng_list.append(fl)
1464 msng_list.append(fl)
1465 for x in sorted(msng_list):
1465 for x in sorted(msng_list):
1466 pfx = self.ui.verbose and ('D ') or ''
1466 pfx = self.ui.verbose and ('D ') or ''
1467 displayname(pfx, x)
1467 displayname(pfx, x, 'missing')
1468
1468
1469 def issaveline(self, l):
1469 def issaveline(self, l):
1470 if l.name == '.hg.patches.save.line':
1470 if l.name == '.hg.patches.save.line':
General Comments 0
You need to be logged in to leave comments. Login now