Show More
@@ -1280,28 +1280,30 b' def version(ui, q=None):' | |||||
1280 |
|
1280 | |||
1281 | def reposetup(ui, repo): |
|
1281 | def reposetup(ui, repo): | |
1282 | repomap[repo] = queue(ui, repo.join("")) |
|
1282 | repomap[repo] = queue(ui, repo.join("")) | |
1283 |
old |
|
1283 | oldtags = repo.tags | |
|
1284 | ||||
|
1285 | def qtags(): | |||
|
1286 | if repo.tagscache: | |||
|
1287 | return repo.tagscache | |||
1284 |
|
1288 | |||
1285 | def qlookup(key): |
|
1289 | tagscache = oldtags() | |
1286 | try: |
|
1290 | ||
1287 | return oldlookup(key) |
|
1291 | q = repomap[repo] | |
1288 | except hg.RepoError: |
|
1292 | if len(q.applied) == 0: | |
1289 | q = repomap[repo] |
|
1293 | return tagscache | |
1290 |
|
1294 | |||
1291 | qpatchnames = { 'qtip': -1, 'qbase': 0 } |
|
1295 | mqtags = [patch.split(':') for patch in q.applied] | |
1292 | if key in qpatchnames: |
|
1296 | mqtags.append((mqtags[-1][0], 'qtip')) | |
1293 | if len(q.applied) == 0: |
|
1297 | mqtags.append((mqtags[0][0], 'qbase')) | |
1294 | self.ui.warn('No patches applied\n') |
|
1298 | for patch in mqtags: | |
1295 | raise |
|
1299 | if patch[1] in tagscache: | |
1296 | patch = q.applied[qpatchnames[key]].split(':')[0] |
|
1300 | repo.ui.warn('Tag %s overrides mq patch of the same name\n' % patch[1]) | |
1297 | return revlog.bin(patch) |
|
1301 | else: | |
|
1302 | tagscache[patch[1]] = revlog.bin(patch[0]) | |||
1298 |
|
1303 | |||
1299 | patch = q.isapplied(key) |
|
1304 | return tagscache | |
1300 | if not patch: |
|
|||
1301 | raise |
|
|||
1302 | return revlog.bin(patch[1]) |
|
|||
1303 |
|
1305 | |||
1304 | repo.lookup = qlookup |
|
1306 | repo.tags = qtags | |
1305 |
|
1307 | |||
1306 | cmdtable = { |
|
1308 | cmdtable = { | |
1307 | "qapplied": (applied, [], 'hg qapplied [PATCH]'), |
|
1309 | "qapplied": (applied, [], 'hg qapplied [PATCH]'), |
General Comments 0
You need to be logged in to leave comments.
Login now