Show More
@@ -489,7 +489,7 class queue(object): | |||
|
489 | 489 | write(_('skipping %s - no matching guards\n') % |
|
490 | 490 | self.series[idx]) |
|
491 | 491 | |
|
492 |
def save |
|
|
492 | def savedirty(self): | |
|
493 | 493 | def write_list(items, path): |
|
494 | 494 | fp = self.opener(path, 'w') |
|
495 | 495 | for i in items: |
@@ -611,7 +611,7 class queue(object): | |||
|
611 | 611 | self.applied_dirty = 1 |
|
612 | 612 | if err: |
|
613 | 613 | return (err, head) |
|
614 |
self.save |
|
|
614 | self.savedirty() | |
|
615 | 615 | return (0, head) |
|
616 | 616 | |
|
617 | 617 | def patch(self, repo, patchfile): |
@@ -639,7 +639,7 class queue(object): | |||
|
639 | 639 | ret = self._apply(repo, series, list, update_status, |
|
640 | 640 | strict, patchdir, merge, all_files=all_files) |
|
641 | 641 | tr.close() |
|
642 |
self.save |
|
|
642 | self.savedirty() | |
|
643 | 643 | return ret |
|
644 | 644 | except: |
|
645 | 645 | try: |
@@ -1511,7 +1511,7 class queue(object): | |||
|
1511 | 1511 | except: |
|
1512 | 1512 | ctx = repo[cparents[0]] |
|
1513 | 1513 | repo.dirstate.rebuild(ctx.node(), ctx.manifest()) |
|
1514 |
self.save |
|
|
1514 | self.savedirty() | |
|
1515 | 1515 | self.ui.warn(_('refresh interrupted while patch was popped! ' |
|
1516 | 1516 | '(revert --all, qpush to recover)\n')) |
|
1517 | 1517 | raise |
@@ -1869,7 +1869,7 def delete(ui, repo, *patches, **opts): | |||
|
1869 | 1869 | use the :hg:`qfinish` command.""" |
|
1870 | 1870 | q = repo.mq |
|
1871 | 1871 | q.delete(repo, patches, opts) |
|
1872 |
q.save |
|
|
1872 | q.savedirty() | |
|
1873 | 1873 | return 0 |
|
1874 | 1874 | |
|
1875 | 1875 | @command("qapplied", |
@@ -1979,7 +1979,7 def qimport(ui, repo, *filename, **opts) | |||
|
1979 | 1979 | existing=opts.get('existing'), force=opts.get('force'), |
|
1980 | 1980 | rev=opts.get('rev'), git=opts.get('git')) |
|
1981 | 1981 | finally: |
|
1982 |
q.save |
|
|
1982 | q.savedirty() | |
|
1983 | 1983 | |
|
1984 | 1984 | if opts.get('push') and not opts.get('rev'): |
|
1985 | 1985 | return q.push(repo, None) |
@@ -1995,7 +1995,7 def qinit(ui, repo, create): | |||
|
1995 | 1995 | Returns 0 if initialization succeeded.""" |
|
1996 | 1996 | q = repo.mq |
|
1997 | 1997 | r = q.init(repo, create) |
|
1998 |
q.save |
|
|
1998 | q.savedirty() | |
|
1999 | 1999 | if r: |
|
2000 | 2000 | if not os.path.exists(r.wjoin('.hgignore')): |
|
2001 | 2001 | fp = r.wopener('.hgignore', 'w') |
@@ -2222,7 +2222,7 def new(ui, repo, patch, *args, **opts): | |||
|
2222 | 2222 | opts['msg'] = msg |
|
2223 | 2223 | setupheaderopts(ui, opts) |
|
2224 | 2224 | q.new(repo, patch, *args, **opts) |
|
2225 |
q.save |
|
|
2225 | q.savedirty() | |
|
2226 | 2226 | return 0 |
|
2227 | 2227 | |
|
2228 | 2228 | @command("^qrefresh", |
@@ -2276,7 +2276,7 def refresh(ui, repo, *pats, **opts): | |||
|
2276 | 2276 | repo.savecommitmessage(message) |
|
2277 | 2277 | setupheaderopts(ui, opts) |
|
2278 | 2278 | ret = q.refresh(repo, pats, msg=message, **opts) |
|
2279 |
q.save |
|
|
2279 | q.savedirty() | |
|
2280 | 2280 | return ret |
|
2281 | 2281 | |
|
2282 | 2282 | @command("^qdiff", |
@@ -2368,7 +2368,7 def fold(ui, repo, *files, **opts): | |||
|
2368 | 2368 | diffopts = q.patchopts(q.diffopts(), *patches) |
|
2369 | 2369 | q.refresh(repo, msg=message, git=diffopts.git) |
|
2370 | 2370 | q.delete(repo, patches, opts) |
|
2371 |
q.save |
|
|
2371 | q.savedirty() | |
|
2372 | 2372 | |
|
2373 | 2373 | @command("qgoto", |
|
2374 | 2374 | [('f', 'force', None, _('overwrite any local changes'))], |
@@ -2383,7 +2383,7 def goto(ui, repo, patch, **opts): | |||
|
2383 | 2383 | ret = q.pop(repo, patch, force=opts.get('force')) |
|
2384 | 2384 | else: |
|
2385 | 2385 | ret = q.push(repo, patch, force=opts.get('force')) |
|
2386 |
q.save |
|
|
2386 | q.savedirty() | |
|
2387 | 2387 | return ret |
|
2388 | 2388 | |
|
2389 | 2389 | @command("qguard", |
@@ -2455,7 +2455,7 def guard(ui, repo, *args, **opts): | |||
|
2455 | 2455 | if idx is None: |
|
2456 | 2456 | raise util.Abort(_('no patch named %s') % patch) |
|
2457 | 2457 | q.setguards(idx, args) |
|
2458 |
q.save |
|
|
2458 | q.savedirty() | |
|
2459 | 2459 | else: |
|
2460 | 2460 | status(q.series.index(q.lookup(patch))) |
|
2461 | 2461 | |
@@ -2561,7 +2561,7 def pop(ui, repo, patch=None, **opts): | |||
|
2561 | 2561 | q = repo.mq |
|
2562 | 2562 | ret = q.pop(repo, patch, force=opts.get('force'), update=localupdate, |
|
2563 | 2563 | all=opts.get('all')) |
|
2564 |
q.save |
|
|
2564 | q.savedirty() | |
|
2565 | 2565 | return ret |
|
2566 | 2566 | |
|
2567 | 2567 | @command("qrename|qmv", [], _('hg qrename PATCH1 [PATCH2]')) |
@@ -2624,7 +2624,7 def rename(ui, repo, patch, name=None, * | |||
|
2624 | 2624 | finally: |
|
2625 | 2625 | wlock.release() |
|
2626 | 2626 | |
|
2627 |
q.save |
|
|
2627 | q.savedirty() | |
|
2628 | 2628 | |
|
2629 | 2629 | @command("qrestore", |
|
2630 | 2630 | [('d', 'delete', None, _('delete save entry')), |
@@ -2638,7 +2638,7 def restore(ui, repo, rev, **opts): | |||
|
2638 | 2638 | q = repo.mq |
|
2639 | 2639 | q.restore(repo, rev, delete=opts.get('delete'), |
|
2640 | 2640 | qupdate=opts.get('update')) |
|
2641 |
q.save |
|
|
2641 | q.savedirty() | |
|
2642 | 2642 | return 0 |
|
2643 | 2643 | |
|
2644 | 2644 | @command("qsave", |
@@ -2657,7 +2657,7 def save(ui, repo, **opts): | |||
|
2657 | 2657 | ret = q.save(repo, msg=message) |
|
2658 | 2658 | if ret: |
|
2659 | 2659 | return ret |
|
2660 |
q.save |
|
|
2660 | q.savedirty() | |
|
2661 | 2661 | if opts.get('copy'): |
|
2662 | 2662 | path = q.path |
|
2663 | 2663 | if opts.get('name'): |
@@ -2755,7 +2755,7 def strip(ui, repo, *revs, **opts): | |||
|
2755 | 2755 | start = i |
|
2756 | 2756 | break |
|
2757 | 2757 | del q.applied[start:end] |
|
2758 |
q.save |
|
|
2758 | q.savedirty() | |
|
2759 | 2759 | |
|
2760 | 2760 | revs = list(rootnodes) |
|
2761 | 2761 | if update and opts.get('keep'): |
@@ -2820,7 +2820,7 def select(ui, repo, *args, **opts): | |||
|
2820 | 2820 | old_guarded = [i for i in xrange(len(q.applied)) if |
|
2821 | 2821 | not q.pushable(i)[0]] |
|
2822 | 2822 | q.setactive(args) |
|
2823 |
q.save |
|
|
2823 | q.savedirty() | |
|
2824 | 2824 | if not args: |
|
2825 | 2825 | ui.status(_('guards deactivated\n')) |
|
2826 | 2826 | if not opts.get('pop') and not opts.get('reapply'): |
@@ -2881,7 +2881,7 def select(ui, repo, *args, **opts): | |||
|
2881 | 2881 | ui.status(_('reapplying unguarded patches\n')) |
|
2882 | 2882 | q.push(repo, reapply) |
|
2883 | 2883 | finally: |
|
2884 |
q.save |
|
|
2884 | q.savedirty() | |
|
2885 | 2885 | |
|
2886 | 2886 | @command("qfinish", |
|
2887 | 2887 | [('a', 'applied', None, _('finish all applied changesets'))], |
@@ -2916,7 +2916,7 def finish(ui, repo, *revrange, **opts): | |||
|
2916 | 2916 | |
|
2917 | 2917 | revs = scmutil.revrange(repo, revrange) |
|
2918 | 2918 | q.finish(repo, revs) |
|
2919 |
q.save |
|
|
2919 | q.savedirty() | |
|
2920 | 2920 | return 0 |
|
2921 | 2921 | |
|
2922 | 2922 | @command("qqueue", |
@@ -404,7 +404,7 def updatemq(repo, state, skipped, **opt | |||
|
404 | 404 | mq.fullseries.remove(pname) |
|
405 | 405 | mq.fullseries.append(s) |
|
406 | 406 | mq.series_dirty = True |
|
407 |
mq.save |
|
|
407 | mq.savedirty() | |
|
408 | 408 | |
|
409 | 409 | def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches, |
|
410 | 410 | external): |
General Comments 0
You need to be logged in to leave comments.
Login now