# HG changeset patch # User Thomas Arendsen Hein # Date 1174247098 -3600 # Node ID 815ad65cfca924c67c31f8a491af784e28efa7ed # Parent da6b148771950a1f876683e7458cd9acb337bc31# Parent e1cdf5f6386e4644a614ceb5eb30b34c60450503 merge with crew-stable diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1146,7 +1146,7 @@ class queue: self.explain_pushable(i) return unapplied - def qseries(self, repo, missing=None, start=0, length=0, status=None, + def qseries(self, repo, missing=None, start=0, length=None, status=None, summary=False): def displayname(patchname): if summary: @@ -1156,27 +1156,23 @@ class queue: msg = '' return '%s%s' % (patchname, msg) - def pname(i): - if status == 'A': - return self.applied[i].name - else: - return self.series[i] - applied = dict.fromkeys([p.name for p in self.applied]) - if not length: + if length is None: length = len(self.series) - start if not missing: for i in xrange(start, start+length): + patch = self.series[i] + if patch in applied: + stat = 'A' + elif self.pushable(i)[0]: + stat = 'U' + else: + stat = 'G' pfx = '' - patch = pname(i) if self.ui.verbose: - if patch in applied: - stat = 'A' - elif self.pushable(i)[0]: - stat = 'U' - else: - stat = 'G' pfx = '%d %s ' % (i, stat) + elif status and status != stat: + continue self.ui.write('%s%s\n' % (pfx, displayname(patch))) else: msng_list = [] @@ -1185,7 +1181,8 @@ class queue: for f in files: fl = os.path.join(d, f) if (fl not in self.series and - fl not in (self.status_path, self.series_path) + fl not in (self.status_path, self.series_path, + self.guards_path) and not fl.startswith('.')): msng_list.append(fl) msng_list.sort() @@ -1460,10 +1457,7 @@ def applied(ui, repo, patch=None, **opts raise util.Abort(_("patch %s is not in series file") % patch) end = q.series.index(patch) + 1 else: - end = len(q.applied) - if not end: - return - + end = q.series_end(True) return q.qseries(repo, length=end, status='A', summary=opts.get('summary')) def unapplied(ui, repo, patch=None, **opts): @@ -1474,8 +1468,8 @@ def unapplied(ui, repo, patch=None, **op raise util.Abort(_("patch %s is not in series file") % patch) start = q.series.index(patch) + 1 else: - start = q.series_end() - q.qseries(repo, start=start, summary=opts.get('summary')) + start = q.series_end(True) + q.qseries(repo, start=start, status='U', summary=opts.get('summary')) def qimport(ui, repo, *filename, **opts): """import a patch @@ -2162,7 +2156,7 @@ cmdtable = { 'hg qfold [-e] [-m ] [-l