##// END OF EJS Templates
Simplified qseries and hg qapplied to fix some bugs caused by optimization:...
Thomas Arendsen Hein -
r4239:417c2068 default
parent child Browse files
Show More
@@ -1111,7 +1111,7 b' class queue:'
1111 self.explain_pushable(i)
1111 self.explain_pushable(i)
1112 return unapplied
1112 return unapplied
1113
1113
1114 def qseries(self, repo, missing=None, start=0, length=0, status=None,
1114 def qseries(self, repo, missing=None, start=0, length=None, status=None,
1115 summary=False):
1115 summary=False):
1116 def displayname(patchname):
1116 def displayname(patchname):
1117 if summary:
1117 if summary:
@@ -1121,28 +1121,22 b' class queue:'
1121 msg = ''
1121 msg = ''
1122 return '%s%s' % (patchname, msg)
1122 return '%s%s' % (patchname, msg)
1123
1123
1124 def pname(i):
1125 if status == 'A':
1126 return self.applied[i].name
1127 else:
1128 return self.series[i]
1129
1130 applied = dict.fromkeys([p.name for p in self.applied])
1124 applied = dict.fromkeys([p.name for p in self.applied])
1131 if not length:
1125 if length is None:
1132 length = len(self.series) - start
1126 length = len(self.series) - start
1133 if not missing:
1127 if not missing:
1134 for i in xrange(start, start+length):
1128 for i in xrange(start, start+length):
1135 pfx = ''
1129 patch = self.series[i]
1136 patch = pname(i)
1137 if self.ui.verbose:
1138 if patch in applied:
1130 if patch in applied:
1139 stat = 'A'
1131 stat = 'A'
1140 elif self.pushable(i)[0]:
1132 elif self.pushable(i)[0]:
1141 stat = 'U'
1133 stat = 'U'
1142 else:
1134 else:
1143 stat = 'G'
1135 stat = 'G'
1136 pfx = ''
1137 if self.ui.verbose:
1144 pfx = '%d %s ' % (i, stat)
1138 pfx = '%d %s ' % (i, stat)
1145 elif status == 'U' and not self.pushable(i)[0]:
1139 elif status and status != stat:
1146 continue
1140 continue
1147 self.ui.write('%s%s\n' % (pfx, displayname(patch)))
1141 self.ui.write('%s%s\n' % (pfx, displayname(patch)))
1148 else:
1142 else:
@@ -1426,10 +1420,7 b' def applied(ui, repo, patch=None, **opts'
1426 raise util.Abort(_("patch %s is not in series file") % patch)
1420 raise util.Abort(_("patch %s is not in series file") % patch)
1427 end = q.series.index(patch) + 1
1421 end = q.series.index(patch) + 1
1428 else:
1422 else:
1429 end = len(q.applied)
1423 end = q.series_end(True)
1430 if not end:
1431 return
1432
1433 return q.qseries(repo, length=end, status='A', summary=opts.get('summary'))
1424 return q.qseries(repo, length=end, status='A', summary=opts.get('summary'))
1434
1425
1435 def unapplied(ui, repo, patch=None, **opts):
1426 def unapplied(ui, repo, patch=None, **opts):
General Comments 0
You need to be logged in to leave comments. Login now