Show More
@@ -39,7 +39,7 b' versionstr = "0.45"' | |||||
39 |
|
39 | |||
40 | commands.norepo += " qclone qversion" |
|
40 | commands.norepo += " qclone qversion" | |
41 |
|
41 | |||
42 |
class |
|
42 | class statusentry: | |
43 | def __init__(self, rev, name=None): |
|
43 | def __init__(self, rev, name=None): | |
44 | if not name: |
|
44 | if not name: | |
45 | fields = rev.split(':') |
|
45 | fields = rev.split(':') | |
@@ -74,7 +74,7 b' class queue:' | |||||
74 | self.parse_series() |
|
74 | self.parse_series() | |
75 |
|
75 | |||
76 | if os.path.exists(os.path.join(self.path, self.status_path)): |
|
76 | if os.path.exists(os.path.join(self.path, self.status_path)): | |
77 |
self.applied = [ |
|
77 | self.applied = [statusentry(l) | |
78 | for l in self.opener(self.status_path).read().splitlines()] |
|
78 | for l in self.opener(self.status_path).read().splitlines()] | |
79 |
|
79 | |||
80 | def find_series(self, patch): |
|
80 | def find_series(self, patch): | |
@@ -247,7 +247,7 b' class queue:' | |||||
247 | pname = ".hg.patches.merge.marker" |
|
247 | pname = ".hg.patches.merge.marker" | |
248 | n = repo.commit(None, '[mq]: merge marker', user=None, force=1, |
|
248 | n = repo.commit(None, '[mq]: merge marker', user=None, force=1, | |
249 | wlock=wlock) |
|
249 | wlock=wlock) | |
250 |
self.applied.append( |
|
250 | self.applied.append(statusentry(revlog.hex(n), pname)) | |
251 | self.applied_dirty = 1 |
|
251 | self.applied_dirty = 1 | |
252 |
|
252 | |||
253 | head = self.qparents(repo) |
|
253 | head = self.qparents(repo) | |
@@ -265,7 +265,7 b' class queue:' | |||||
265 | rev = revlog.bin(info[1]) |
|
265 | rev = revlog.bin(info[1]) | |
266 | (err, head) = self.mergeone(repo, mergeq, head, patch, rev, wlock) |
|
266 | (err, head) = self.mergeone(repo, mergeq, head, patch, rev, wlock) | |
267 | if head: |
|
267 | if head: | |
268 |
self.applied.append( |
|
268 | self.applied.append(statusentry(revlog.hex(head), patch)) | |
269 | self.applied_dirty = 1 |
|
269 | self.applied_dirty = 1 | |
270 | if err: |
|
270 | if err: | |
271 | return (err, head) |
|
271 | return (err, head) | |
@@ -360,7 +360,7 b' class queue:' | |||||
360 | raise util.Abort(_("repo commit failed")) |
|
360 | raise util.Abort(_("repo commit failed")) | |
361 |
|
361 | |||
362 | if update_status: |
|
362 | if update_status: | |
363 |
self.applied.append( |
|
363 | self.applied.append(statusentry(revlog.hex(n), patch)) | |
364 |
|
364 | |||
365 | if patcherr: |
|
365 | if patcherr: | |
366 | if not patchfound: |
|
366 | if not patchfound: | |
@@ -429,7 +429,7 b' class queue:' | |||||
429 | if n == None: |
|
429 | if n == None: | |
430 | raise util.Abort(_("repo commit failed")) |
|
430 | raise util.Abort(_("repo commit failed")) | |
431 | self.full_series[insert:insert] = [patch] |
|
431 | self.full_series[insert:insert] = [patch] | |
432 |
self.applied.append( |
|
432 | self.applied.append(statusentry(revlog.hex(n), patch)) | |
433 | self.parse_series() |
|
433 | self.parse_series() | |
434 | self.series_dirty = 1 |
|
434 | self.series_dirty = 1 | |
435 | self.applied_dirty = 1 |
|
435 | self.applied_dirty = 1 | |
@@ -904,7 +904,7 b' class queue:' | |||||
904 |
|
904 | |||
905 | self.strip(repo, top, update=False, backup='strip', wlock=wlock) |
|
905 | self.strip(repo, top, update=False, backup='strip', wlock=wlock) | |
906 | n = repo.commit(filelist, message, changes[1], force=1, wlock=wlock) |
|
906 | n = repo.commit(filelist, message, changes[1], force=1, wlock=wlock) | |
907 |
self.applied[-1] = |
|
907 | self.applied[-1] = statusentry(revlog.hex(n), patch) | |
908 | self.applied_dirty = 1 |
|
908 | self.applied_dirty = 1 | |
909 | else: |
|
909 | else: | |
910 | commands.dodiff(patchf, self.ui, repo, patchparent, None) |
|
910 | commands.dodiff(patchf, self.ui, repo, patchparent, None) | |
@@ -987,7 +987,7 b' class queue:' | |||||
987 | qpp = [ hg.bin(x) for x in l ] |
|
987 | qpp = [ hg.bin(x) for x in l ] | |
988 | elif datastart != None: |
|
988 | elif datastart != None: | |
989 | l = lines[i].rstrip() |
|
989 | l = lines[i].rstrip() | |
990 |
se = |
|
990 | se = statusentry(l) | |
991 | file_ = se.name |
|
991 | file_ = se.name | |
992 | if se.rev: |
|
992 | if se.rev: | |
993 | applied.append(se) |
|
993 | applied.append(se) | |
@@ -1048,7 +1048,7 b' class queue:' | |||||
1048 | if not n: |
|
1048 | if not n: | |
1049 | self.ui.warn("repo commit failed\n") |
|
1049 | self.ui.warn("repo commit failed\n") | |
1050 | return 1 |
|
1050 | return 1 | |
1051 |
self.applied.append( |
|
1051 | self.applied.append(statusentry(revlog.hex(n),'.hg.patches.save.line')) | |
1052 | self.applied_dirty = 1 |
|
1052 | self.applied_dirty = 1 | |
1053 |
|
1053 | |||
1054 | def full_series_end(self): |
|
1054 | def full_series_end(self): | |
@@ -1482,7 +1482,7 b' def rename(ui, repo, patch, name=None, *' | |||||
1482 |
|
1482 | |||
1483 | info = q.isapplied(patch) |
|
1483 | info = q.isapplied(patch) | |
1484 | if info: |
|
1484 | if info: | |
1485 |
q.applied[info[0]] = |
|
1485 | q.applied[info[0]] = statusentry(info[1], name) | |
1486 | q.applied_dirty = 1 |
|
1486 | q.applied_dirty = 1 | |
1487 |
|
1487 | |||
1488 | util.rename(os.path.join(q.path, patch), absdest) |
|
1488 | util.rename(os.path.join(q.path, patch), absdest) | |
@@ -1552,12 +1552,12 b' def version(ui, q=None):' | |||||
1552 | return 0 |
|
1552 | return 0 | |
1553 |
|
1553 | |||
1554 | def reposetup(ui, repo): |
|
1554 | def reposetup(ui, repo): | |
1555 |
class |
|
1555 | class mqrepo(repo.__class__): | |
1556 | def tags(self): |
|
1556 | def tags(self): | |
1557 | if self.tagscache: |
|
1557 | if self.tagscache: | |
1558 | return self.tagscache |
|
1558 | return self.tagscache | |
1559 |
|
1559 | |||
1560 |
tagscache = super( |
|
1560 | tagscache = super(mqrepo, self).tags() | |
1561 |
|
1561 | |||
1562 | q = self.mq |
|
1562 | q = self.mq | |
1563 | if not q.applied: |
|
1563 | if not q.applied: | |
@@ -1574,7 +1574,7 b' def reposetup(ui, repo):' | |||||
1574 |
|
1574 | |||
1575 | return tagscache |
|
1575 | return tagscache | |
1576 |
|
1576 | |||
1577 |
repo.__class__ = |
|
1577 | repo.__class__ = mqrepo | |
1578 | repo.mq = queue(ui, repo.join("")) |
|
1578 | repo.mq = queue(ui, repo.join("")) | |
1579 |
|
1579 | |||
1580 | cmdtable = { |
|
1580 | cmdtable = { |
General Comments 0
You need to be logged in to leave comments.
Login now