Show More
@@ -302,7 +302,7 b' class queue(object):' | |||||
302 | return [] |
|
302 | return [] | |
303 |
|
303 | |||
304 | @util.propertycache |
|
304 | @util.propertycache | |
305 |
def full |
|
305 | def fullseries(self): | |
306 | if os.path.exists(self.join(self.series_path)): |
|
306 | if os.path.exists(self.join(self.series_path)): | |
307 | return self.opener.read(self.series_path).splitlines() |
|
307 | return self.opener.read(self.series_path).splitlines() | |
308 | return [] |
|
308 | return [] | |
@@ -318,7 +318,7 b' class queue(object):' | |||||
318 | return self.series_guards |
|
318 | return self.series_guards | |
319 |
|
319 | |||
320 | def invalidate(self): |
|
320 | def invalidate(self): | |
321 |
for a in 'applied full |
|
321 | for a in 'applied fullseries series series_guards'.split(): | |
322 | if a in self.__dict__: |
|
322 | if a in self.__dict__: | |
323 | delattr(self, a) |
|
323 | delattr(self, a) | |
324 | self.applied_dirty = 0 |
|
324 | self.applied_dirty = 0 | |
@@ -364,7 +364,7 b' class queue(object):' | |||||
364 | def matchpatch(l): |
|
364 | def matchpatch(l): | |
365 | l = l.split('#', 1)[0] |
|
365 | l = l.split('#', 1)[0] | |
366 | return l.strip() == patch |
|
366 | return l.strip() == patch | |
367 |
for index, l in enumerate(self.full |
|
367 | for index, l in enumerate(self.fullseries): | |
368 | if matchpatch(l): |
|
368 | if matchpatch(l): | |
369 | return index |
|
369 | return index | |
370 | return None |
|
370 | return None | |
@@ -374,7 +374,7 b' class queue(object):' | |||||
374 | def parse_series(self): |
|
374 | def parse_series(self): | |
375 | self.series = [] |
|
375 | self.series = [] | |
376 | self.series_guards = [] |
|
376 | self.series_guards = [] | |
377 |
for l in self.full |
|
377 | for l in self.fullseries: | |
378 | h = l.find('#') |
|
378 | h = l.find('#') | |
379 | if h == -1: |
|
379 | if h == -1: | |
380 | patch = l |
|
380 | patch = l | |
@@ -441,8 +441,8 b' class queue(object):' | |||||
441 | bad = self.check_guard(g[1:]) |
|
441 | bad = self.check_guard(g[1:]) | |
442 | if bad: |
|
442 | if bad: | |
443 | raise util.Abort(bad) |
|
443 | raise util.Abort(bad) | |
444 |
drop = self.guard_re.sub('', self.full |
|
444 | drop = self.guard_re.sub('', self.fullseries[idx]) | |
445 |
self.full |
|
445 | self.fullseries[idx] = drop + ''.join([' #' + g for g in guards]) | |
446 | self.parse_series() |
|
446 | self.parse_series() | |
447 | self.series_dirty = True |
|
447 | self.series_dirty = True | |
448 |
|
448 | |||
@@ -498,7 +498,7 b' class queue(object):' | |||||
498 | if self.applied_dirty: |
|
498 | if self.applied_dirty: | |
499 | write_list(map(str, self.applied), self.status_path) |
|
499 | write_list(map(str, self.applied), self.status_path) | |
500 | if self.series_dirty: |
|
500 | if self.series_dirty: | |
501 |
write_list(self.full |
|
501 | write_list(self.fullseries, self.series_path) | |
502 | if self.guards_dirty: |
|
502 | if self.guards_dirty: | |
503 | write_list(self.active_guards, self.guards_path) |
|
503 | write_list(self.active_guards, self.guards_path) | |
504 | if self.added: |
|
504 | if self.added: | |
@@ -749,7 +749,7 b' class queue(object):' | |||||
749 | for (i, p) in sorted([(self.find_series(p), p) for p in patches], |
|
749 | for (i, p) in sorted([(self.find_series(p), p) for p in patches], | |
750 | reverse=True): |
|
750 | reverse=True): | |
751 | if i is not None: |
|
751 | if i is not None: | |
752 |
del self.full |
|
752 | del self.fullseries[i] | |
753 | else: |
|
753 | else: | |
754 | unknown.append(p) |
|
754 | unknown.append(p) | |
755 |
|
755 | |||
@@ -945,7 +945,7 b' class queue(object):' | |||||
945 | if n is None: |
|
945 | if n is None: | |
946 | raise util.Abort(_("repo commit failed")) |
|
946 | raise util.Abort(_("repo commit failed")) | |
947 | try: |
|
947 | try: | |
948 |
self.full |
|
948 | self.fullseries[insert:insert] = [patchfn] | |
949 | self.applied.append(statusentry(n, patchfn)) |
|
949 | self.applied.append(statusentry(n, patchfn)) | |
950 | self.parse_series() |
|
950 | self.parse_series() | |
951 | self.series_dirty = 1 |
|
951 | self.series_dirty = 1 | |
@@ -1150,15 +1150,15 b' class queue(object):' | |||||
1150 | if move: |
|
1150 | if move: | |
1151 | if not patch: |
|
1151 | if not patch: | |
1152 | raise util.Abort(_("please specify the patch to move")) |
|
1152 | raise util.Abort(_("please specify the patch to move")) | |
1153 |
for i, rpn in enumerate(self.full |
|
1153 | for i, rpn in enumerate(self.fullseries[start:]): | |
1154 | # strip markers for patch guards |
|
1154 | # strip markers for patch guards | |
1155 | if self.guard_re.split(rpn, 1)[0] == patch: |
|
1155 | if self.guard_re.split(rpn, 1)[0] == patch: | |
1156 | break |
|
1156 | break | |
1157 | index = start + i |
|
1157 | index = start + i | |
1158 |
assert index < len(self.full |
|
1158 | assert index < len(self.fullseries) | |
1159 |
fullpatch = self.full |
|
1159 | fullpatch = self.fullseries[index] | |
1160 |
del self.full |
|
1160 | del self.fullseries[index] | |
1161 |
self.full |
|
1161 | self.fullseries.insert(start, fullpatch) | |
1162 | self.parse_series() |
|
1162 | self.parse_series() | |
1163 | self.series_dirty = 1 |
|
1163 | self.series_dirty = 1 | |
1164 |
|
1164 | |||
@@ -1638,7 +1638,7 b' class queue(object):' | |||||
1638 | self.ui.warn(_("No saved patch data found\n")) |
|
1638 | self.ui.warn(_("No saved patch data found\n")) | |
1639 | return 1 |
|
1639 | return 1 | |
1640 | self.ui.warn(_("restoring status: %s\n") % lines[0]) |
|
1640 | self.ui.warn(_("restoring status: %s\n") % lines[0]) | |
1641 |
self.full |
|
1641 | self.fullseries = series | |
1642 | self.applied = applied |
|
1642 | self.applied = applied | |
1643 | self.parse_series() |
|
1643 | self.parse_series() | |
1644 | self.series_dirty = 1 |
|
1644 | self.series_dirty = 1 | |
@@ -1684,7 +1684,7 b' class queue(object):' | |||||
1684 | msg += "\nDirstate: %s %s" % (hex(pp[0]), hex(pp[1])) |
|
1684 | msg += "\nDirstate: %s %s" % (hex(pp[0]), hex(pp[1])) | |
1685 | msg += "\n\nPatch Data:\n" |
|
1685 | msg += "\n\nPatch Data:\n" | |
1686 | msg += ''.join('%s\n' % x for x in self.applied) |
|
1686 | msg += ''.join('%s\n' % x for x in self.applied) | |
1687 |
msg += ''.join(':%s\n' % x for x in self.full |
|
1687 | msg += ''.join(':%s\n' % x for x in self.fullseries) | |
1688 | n = repo.commit(msg, force=True) |
|
1688 | n = repo.commit(msg, force=True) | |
1689 | if not n: |
|
1689 | if not n: | |
1690 | self.ui.warn(_("repo commit failed\n")) |
|
1690 | self.ui.warn(_("repo commit failed\n")) | |
@@ -1698,7 +1698,7 b' class queue(object):' | |||||
1698 | p = self.applied[-1].name |
|
1698 | p = self.applied[-1].name | |
1699 | end = self.find_series(p) |
|
1699 | end = self.find_series(p) | |
1700 | if end is None: |
|
1700 | if end is None: | |
1701 |
return len(self.full |
|
1701 | return len(self.fullseries) | |
1702 | return end + 1 |
|
1702 | return end + 1 | |
1703 | return 0 |
|
1703 | return 0 | |
1704 |
|
1704 | |||
@@ -1789,7 +1789,7 b' class queue(object):' | |||||
1789 | patchname = normname('%d.diff' % r) |
|
1789 | patchname = normname('%d.diff' % r) | |
1790 | checkseries(patchname) |
|
1790 | checkseries(patchname) | |
1791 | self.checkpatchname(patchname, force) |
|
1791 | self.checkpatchname(patchname, force) | |
1792 |
self.full |
|
1792 | self.fullseries.insert(0, patchname) | |
1793 |
|
1793 | |||
1794 | patchf = self.opener(patchname, "w") |
|
1794 | patchf = self.opener(patchname, "w") | |
1795 | cmdutil.export(repo, [n], fp=patchf, opts=diffopts) |
|
1795 | cmdutil.export(repo, [n], fp=patchf, opts=diffopts) | |
@@ -1845,7 +1845,7 b' class queue(object):' | |||||
1845 | checkseries(patchname) |
|
1845 | checkseries(patchname) | |
1846 | if patchname not in self.series: |
|
1846 | if patchname not in self.series: | |
1847 | index = self.full_series_end() + i |
|
1847 | index = self.full_series_end() + i | |
1848 |
self.full |
|
1848 | self.fullseries[index:index] = [patchname] | |
1849 | self.parse_series() |
|
1849 | self.parse_series() | |
1850 | self.series_dirty = True |
|
1850 | self.series_dirty = True | |
1851 | self.ui.warn(_("adding %s to series file\n") % patchname) |
|
1851 | self.ui.warn(_("adding %s to series file\n") % patchname) | |
@@ -2594,8 +2594,8 b' def rename(ui, repo, patch, name=None, *' | |||||
2594 |
|
2594 | |||
2595 | ui.note(_('renaming %s to %s\n') % (patch, name)) |
|
2595 | ui.note(_('renaming %s to %s\n') % (patch, name)) | |
2596 | i = q.find_series(patch) |
|
2596 | i = q.find_series(patch) | |
2597 |
guards = q.guard_re.findall(q.full |
|
2597 | guards = q.guard_re.findall(q.fullseries[i]) | |
2598 |
q.full |
|
2598 | q.fullseries[i] = name + ''.join([' #' + g for g in guards]) | |
2599 | q.parse_series() |
|
2599 | q.parse_series() | |
2600 | q.series_dirty = 1 |
|
2600 | q.series_dirty = 1 | |
2601 |
|
2601 |
@@ -376,7 +376,7 b' def updatemq(repo, state, skipped, **opt' | |||||
376 | 'Update rebased mq patches - finalize and then import them' |
|
376 | 'Update rebased mq patches - finalize and then import them' | |
377 | mqrebase = {} |
|
377 | mqrebase = {} | |
378 | mq = repo.mq |
|
378 | mq = repo.mq | |
379 |
original_series = mq.full |
|
379 | original_series = mq.fullseries[:] | |
380 |
|
380 | |||
381 | for p in mq.applied: |
|
381 | for p in mq.applied: | |
382 | rev = repo[p.node].rev() |
|
382 | rev = repo[p.node].rev() | |
@@ -399,10 +399,10 b' def updatemq(repo, state, skipped, **opt' | |||||
399 | # Restore missing guards |
|
399 | # Restore missing guards | |
400 | for s in original_series: |
|
400 | for s in original_series: | |
401 | pname = mq.guard_re.split(s, 1)[0] |
|
401 | pname = mq.guard_re.split(s, 1)[0] | |
402 |
if pname in mq.full |
|
402 | if pname in mq.fullseries: | |
403 | repo.ui.debug('restoring guard for patch %s' % (pname)) |
|
403 | repo.ui.debug('restoring guard for patch %s' % (pname)) | |
404 |
mq.full |
|
404 | mq.fullseries.remove(pname) | |
405 |
mq.full |
|
405 | mq.fullseries.append(s) | |
406 | mq.series_dirty = True |
|
406 | mq.series_dirty = True | |
407 | mq.save_dirty() |
|
407 | mq.save_dirty() | |
408 |
|
408 |
General Comments 0
You need to be logged in to leave comments.
Login now