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