Show More
@@ -46,7 +46,7 b' from mercurial.i18n import _' | |||
|
46 | 46 | from mercurial.node import bin, hex, short, nullid, nullrev |
|
47 | 47 | from mercurial.lock import release |
|
48 | 48 | from mercurial import commands, cmdutil, hg, scmutil, util, revset |
|
49 | from mercurial import repair, extensions, url, error | |
|
49 | from mercurial import repair, extensions, url, error, phases | |
|
50 | 50 | from mercurial import patch as patchmod |
|
51 | 51 | import os, re, errno, shutil |
|
52 | 52 | |
@@ -750,6 +750,7 b' class queue(object):' | |||
|
750 | 750 | for p in patches: |
|
751 | 751 | os.unlink(self.join(p)) |
|
752 | 752 | |
|
753 | qfinished = [] | |
|
753 | 754 | if numrevs: |
|
754 | 755 | qfinished = self.applied[:numrevs] |
|
755 | 756 | del self.applied[:numrevs] |
@@ -776,6 +777,7 b' class queue(object):' | |||
|
776 | 777 | |
|
777 | 778 | self.parseseries() |
|
778 | 779 | self.seriesdirty = True |
|
780 | return [entry.node for entry in qfinished] | |
|
779 | 781 | |
|
780 | 782 | def _revpatches(self, repo, revs): |
|
781 | 783 | firstrev = repo[self.applied[0].node].rev() |
@@ -803,7 +805,11 b' class queue(object):' | |||
|
803 | 805 | |
|
804 | 806 | def finish(self, repo, revs): |
|
805 | 807 | patches = self._revpatches(repo, sorted(revs)) |
|
806 | self._cleanup(patches, len(patches)) | |
|
808 | qfinished = self._cleanup(patches, len(patches)) | |
|
809 | if qfinished: | |
|
810 | oldqbase = repo[qfinished[0]] | |
|
811 | if oldqbase.p1().phase() < phases.secret: | |
|
812 | phases.advanceboundary(repo, phases.draft, [oldqbase.node()]) | |
|
807 | 813 | |
|
808 | 814 | def delete(self, repo, patches, opts): |
|
809 | 815 | if not patches and not opts.get('rev'): |
@@ -2918,9 +2924,15 b' def finish(ui, repo, *revrange, **opts):' | |||
|
2918 | 2924 | revs = scmutil.revrange(repo, revrange) |
|
2919 | 2925 | if repo['.'].rev() in revs and repo[None].files(): |
|
2920 | 2926 | ui.warn(_('warning: uncommitted changes in the working directory\n')) |
|
2921 | ||
|
2922 | q.finish(repo, revs) | |
|
2923 | q.savedirty() | |
|
2927 | # queue.finish may changes phases but leave the responsability to lock the | |
|
2928 | # repo to the caller to avoid deadlock with wlock. This command code is | |
|
2929 | # responsability for this locking. | |
|
2930 | lock = repo.lock() | |
|
2931 | try: | |
|
2932 | q.finish(repo, revs) | |
|
2933 | q.savedirty() | |
|
2934 | finally: | |
|
2935 | lock.release() | |
|
2924 | 2936 | return 0 |
|
2925 | 2937 | |
|
2926 | 2938 | @command("qqueue", |
General Comments 0
You need to be logged in to leave comments.
Login now