Mercurial > hg
comparison hgext/mq.py @ 2690:e9ecc45795e8
merge with crew
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 27 Jul 2006 12:34:02 +0200 |
parents | 4e2dc5c16e61 |
children | 0fb28dbf0dc7 |
comparison
equal
deleted
inserted
replaced
2689:489c3bacce96 | 2690:e9ecc45795e8 |
---|---|
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') |
1270 ui.write("mq version %s\n" % versionstr) | 1278 ui.write("mq version %s\n" % versionstr) |
1271 return 0 | 1279 return 0 |
1272 | 1280 |
1273 def reposetup(ui, repo): | 1281 def reposetup(ui, repo): |
1274 repomap[repo] = queue(ui, repo.join("")) | 1282 repomap[repo] = queue(ui, repo.join("")) |
1283 oldtags = repo.tags | |
1284 | |
1285 def qtags(): | |
1286 if repo.tagscache: | |
1287 return repo.tagscache | |
1288 | |
1289 tagscache = oldtags() | |
1290 | |
1291 q = repomap[repo] | |
1292 if len(q.applied) == 0: | |
1293 return tagscache | |
1294 | |
1295 mqtags = [patch.split(':') for patch in q.applied] | |
1296 mqtags.append((mqtags[-1][0], 'qtip')) | |
1297 mqtags.append((mqtags[0][0], 'qbase')) | |
1298 for patch in mqtags: | |
1299 if patch[1] in tagscache: | |
1300 repo.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1]) | |
1301 else: | |
1302 tagscache[patch[1]] = revlog.bin(patch[0]) | |
1303 | |
1304 return tagscache | |
1305 | |
1306 repo.tags = qtags | |
1275 | 1307 |
1276 cmdtable = { | 1308 cmdtable = { |
1277 "qapplied": (applied, [], 'hg qapplied [PATCH]'), | 1309 "qapplied": (applied, [], 'hg qapplied [PATCH]'), |
1278 "qcommit|qci": | 1310 "qcommit|qci": |
1279 (commit, | 1311 (commit, |