Mercurial > hg
annotate hgext/strip.py @ 32751:627eaab1ad07
tests: factor external procedures out for portability
Fortunately, "&&" is treated as "execute next, if previous doesn't
fail" both on POSIX and Windows. But keeping portability of
"dirstaterace.command" manually is troublesome.
This patch factors external procedures out as a shell script for
portability. "sh SCRIPT" always allows scripting in POSIX style.
This change is also for convenience. Fixed script name can reduce
command line arguments.
"r" prefix is needed for "sh '$TESTTMP/dirstaterace.sh'", because
$TESTTMP contains backslash on Windows.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 09 Jun 2017 13:07:49 +0900 |
parents | 46ba2cdda476 |
children | 799db2af824c |
rev | line source |
---|---|
23139
e53f6b72a0e4
spelling: fixes from proofreading of spell checker issues
Mads Kiilerich <madski@unity3d.com>
parents:
22925
diff
changeset
|
1 """strip changesets and their descendants from history |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
2 |
19945
3d42a85f6922
strip: fix spelling: "allows to" -> "allows you to"
Javi Merino <cibervicho@gmail.com>
parents:
19828
diff
changeset
|
3 This extension allows you to strip changesets and all their descendants from the |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
4 repository. See the command help for details. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
5 """ |
28377
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
6 from __future__ import absolute_import |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
7 |
29205
a0939666b836
py3: move up symbol imports to enforce import-checker rules
Yuya Nishihara <yuya@tcha.org>
parents:
28377
diff
changeset
|
8 from mercurial.i18n import _ |
28377
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
9 from mercurial import ( |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
10 bookmarks as bookmarksmod, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
11 cmdutil, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
12 error, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
13 hg, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
14 lock as lockmod, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
15 merge, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
16 node as nodemod, |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29841
diff
changeset
|
17 registrar, |
28377
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
18 repair, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
19 scmutil, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
20 util, |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
21 ) |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
22 nullid = nodemod.nullid |
81ad683278b8
strip: use absolute_import
timeless <timeless@mozdev.org>
parents:
28288
diff
changeset
|
23 release = lockmod.release |
19822
a194a33f8cb2
mq: prepare a strip extension for extraction
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
24 |
a194a33f8cb2
mq: prepare a strip extension for extraction
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff
changeset
|
25 cmdtable = {} |
32337
46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents:
29841
diff
changeset
|
26 command = registrar.command(cmdtable) |
29841
d5883fd055c6
extensions: change magic "shipped with hg" string
Augie Fackler <augie@google.com>
parents:
29205
diff
changeset
|
27 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
25186
80c5b2666a96
extensions: document that `testedwith = 'internal'` is special
Augie Fackler <augie@google.com>
parents:
24947
diff
changeset
|
28 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
80c5b2666a96
extensions: document that `testedwith = 'internal'` is special
Augie Fackler <augie@google.com>
parents:
24947
diff
changeset
|
29 # be specifying the version(s) of Mercurial they are tested with, or |
80c5b2666a96
extensions: document that `testedwith = 'internal'` is special
Augie Fackler <augie@google.com>
parents:
24947
diff
changeset
|
30 # leave the attribute unspecified. |
29841
d5883fd055c6
extensions: change magic "shipped with hg" string
Augie Fackler <augie@google.com>
parents:
29205
diff
changeset
|
31 testedwith = 'ships-with-hg-core' |
19823
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
32 |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
33 def checksubstate(repo, baserev=None): |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
34 '''return list of subrepos at a different revision than substate. |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
35 Abort if any subrepos have uncommitted changes.''' |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
36 inclsubs = [] |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
37 wctx = repo[None] |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
38 if baserev: |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
39 bctx = repo[baserev] |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
40 else: |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
41 bctx = wctx.parents()[0] |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
42 for s in sorted(wctx.substate): |
24471
1ff35d76421c
subrepo: add bailifchanged to centralize raising Abort if subrepo is dirty
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
24364
diff
changeset
|
43 wctx.sub(s).bailifchanged(True) |
1ff35d76421c
subrepo: add bailifchanged to centralize raising Abort if subrepo is dirty
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
24364
diff
changeset
|
44 if s not in bctx.substate or bctx.sub(s).dirty(): |
19823
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
45 inclsubs.append(s) |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
46 return inclsubs |
6fb14d21fe9d
strip: move checksubstate from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19822
diff
changeset
|
47 |
19824
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
48 def checklocalchanges(repo, force=False, excsuffix=''): |
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
49 cmdutil.checkunfinished(repo) |
22925
68df36ce3d8a
strip: make checklocalchanges() return full status tuple
Martin von Zweigbergk <martinvonz@gmail.com>
parents:
22057
diff
changeset
|
50 s = repo.status() |
19824
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
51 if not force: |
22925
68df36ce3d8a
strip: make checklocalchanges() return full status tuple
Martin von Zweigbergk <martinvonz@gmail.com>
parents:
22057
diff
changeset
|
52 if s.modified or s.added or s.removed or s.deleted: |
19824
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
53 _("local changes found") # i18n tool detection |
26587
56b2bcea2529
error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25186
diff
changeset
|
54 raise error.Abort(_("local changes found" + excsuffix)) |
19824
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
55 if checksubstate(repo): |
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
56 _("local changed subrepos found") # i18n tool detection |
26587
56b2bcea2529
error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25186
diff
changeset
|
57 raise error.Abort(_("local changed subrepos found" + excsuffix)) |
22925
68df36ce3d8a
strip: make checklocalchanges() return full status tuple
Martin von Zweigbergk <martinvonz@gmail.com>
parents:
22057
diff
changeset
|
58 return s |
19824
237e40b2c1ff
strip: move checklocalchanges from mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19823
diff
changeset
|
59 |
27029
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
60 def strip(ui, repo, revs, update=True, backup=True, force=None, bookmarks=None): |
19825
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
61 wlock = lock = None |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
62 try: |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
63 wlock = repo.wlock() |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
64 lock = repo.lock() |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
65 |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
66 if update: |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
67 checklocalchanges(repo, force=force) |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
68 urev, p2 = repo.changelog.parents(revs[0]) |
20009
2802bedbd45f
strip: fix last unprotected mq reference (issue4097)
Matt Mackall <mpm@selenic.com>
parents:
19945
diff
changeset
|
69 if (util.safehasattr(repo, 'mq') and |
2802bedbd45f
strip: fix last unprotected mq reference (issue4097)
Matt Mackall <mpm@selenic.com>
parents:
19945
diff
changeset
|
70 p2 != nullid |
2802bedbd45f
strip: fix last unprotected mq reference (issue4097)
Matt Mackall <mpm@selenic.com>
parents:
19945
diff
changeset
|
71 and p2 in [x.node for x in repo.mq.applied]): |
19825
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
72 urev = p2 |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
73 hg.clean(repo, urev) |
26748
5ba0a99ff27f
dirstate: make dirstate.write() callers pass transaction object to it
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
26624
diff
changeset
|
74 repo.dirstate.write(repo.currenttransaction()) |
19825
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
75 |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
76 repair.strip(ui, repo, revs, backup) |
21847
f6f122f4813b
strip: remove bookmarks after strip succeed (issue4295)
David Soria Parra <davidsp@fb.com>
parents:
20102
diff
changeset
|
77 |
26972
4b0c3df5d635
strip: renaming local variables
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26748
diff
changeset
|
78 repomarks = repo._bookmarks |
27029
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
79 if bookmarks: |
27872
a54afc4475d7
with: use a context manager for transaction in strip
Bryan O'Sullivan <bryano@fb.com>
parents:
27839
diff
changeset
|
80 with repo.transaction('strip') as tr: |
27052
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
81 if repo._activebookmark in bookmarks: |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
82 bookmarksmod.deactivate(repo) |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
83 for bookmark in bookmarks: |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
84 del repomarks[bookmark] |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
85 repomarks.recordchange(tr) |
27872
a54afc4475d7
with: use a context manager for transaction in strip
Bryan O'Sullivan <bryano@fb.com>
parents:
27839
diff
changeset
|
86 for bookmark in sorted(bookmarks): |
a54afc4475d7
with: use a context manager for transaction in strip
Bryan O'Sullivan <bryano@fb.com>
parents:
27839
diff
changeset
|
87 ui.write(_("bookmark '%s' deleted\n") % bookmark) |
19825
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
88 finally: |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
89 release(lock, wlock) |
4b4997068143
strip: move the strip helper function for mq to strip
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19824
diff
changeset
|
90 |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
91 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
92 @command("strip", |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
93 [ |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
94 ('r', 'rev', [], _('strip specified revision (optional, ' |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
95 'can specify revisions without this ' |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
96 'option)'), _('REV')), |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
97 ('f', 'force', None, _('force removal of changesets, discard ' |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
98 'uncommitted changes (no backup)')), |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
99 ('', 'no-backup', None, _('no backups')), |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
100 ('', 'nobackup', None, _('no backups (DEPRECATED)')), |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
101 ('n', '', None, _('ignored (DEPRECATED)')), |
24364
135b23868f45
commands: replace "working copy" with "working directory" in help/messages
Yuya Nishihara <yuya@tcha.org>
parents:
23139
diff
changeset
|
102 ('k', 'keep', None, _("do not modify working directory during " |
135b23868f45
commands: replace "working copy" with "working directory" in help/messages
Yuya Nishihara <yuya@tcha.org>
parents:
23139
diff
changeset
|
103 "strip")), |
27030
cf9ed6d32ccb
strip: changing bookmark argument to be a list
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
27029
diff
changeset
|
104 ('B', 'bookmark', [], _("remove revs only reachable from given" |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
105 " bookmark"))], |
28288
e417e4512b0f
doc: remove deprecated option from synopsis of command help
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
27872
diff
changeset
|
106 _('hg strip [-k] [-f] [-B bookmark] [-r] REV...')) |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
107 def stripcmd(ui, repo, *revs, **opts): |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
108 """strip changesets and all their descendants from the repository |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
109 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
110 The strip command removes the specified changesets and all their |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
111 descendants. If the working directory has uncommitted changes, the |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
112 operation is aborted unless the --force flag is supplied, in which |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
113 case changes will be discarded. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
114 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
115 If a parent of the working directory is stripped, then the working |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
116 directory will automatically be updated to the most recent |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
117 available ancestor of the stripped parent after the operation |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
118 completes. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
119 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
120 Any stripped changesets are stored in ``.hg/strip-backup`` as a |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
121 bundle (see :hg:`help bundle` and :hg:`help unbundle`). They can |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
122 be restored by running :hg:`unbundle .hg/strip-backup/BUNDLE`, |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
123 where BUNDLE is the bundle file created by the strip. Note that |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
124 the local revision numbers will in general be different after the |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
125 restore. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
126 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
127 Use the --no-backup option to discard the backup bundle once the |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
128 operation completes. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
129 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
130 Strip is not a history-rewriting operation and can be used on |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
131 changesets in the public phase. But if the stripped changesets have |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
132 been pushed to a remote repository you will likely pull them again. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
133 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
134 Return 0 on success. |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
135 """ |
22057
445472225ccd
strip: remove -b/--backup codepaths
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21854
diff
changeset
|
136 backup = True |
445472225ccd
strip: remove -b/--backup codepaths
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21854
diff
changeset
|
137 if opts.get('no_backup') or opts.get('nobackup'): |
445472225ccd
strip: remove -b/--backup codepaths
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
21854
diff
changeset
|
138 backup = False |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
139 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
140 cl = repo.changelog |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
141 revs = list(revs) + opts.get('rev') |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
142 revs = set(scmutil.revrange(repo, revs)) |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
143 |
27839
7ec3cb246291
with: use context manager for wlock in shelve stripcmd
Bryan O'Sullivan <bryano@fb.com>
parents:
27052
diff
changeset
|
144 with repo.wlock(): |
27030
cf9ed6d32ccb
strip: changing bookmark argument to be a list
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
27029
diff
changeset
|
145 bookmarks = set(opts.get('bookmark')) |
27029
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
146 if bookmarks: |
26972
4b0c3df5d635
strip: renaming local variables
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26748
diff
changeset
|
147 repomarks = repo._bookmarks |
27029
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
148 if not bookmarks.issubset(repomarks): |
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
149 raise error.Abort(_("bookmark '%s' not found") % |
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
150 ','.join(sorted(bookmarks - set(repomarks.keys())))) |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
151 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
152 # If the requested bookmark is not the only one pointing to a |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
153 # a revision we have to only delete the bookmark and not strip |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
154 # anything. revsets cannot detect that case. |
27029
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
155 nodetobookmarks = {} |
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
156 for mark, node in repomarks.iteritems(): |
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
157 nodetobookmarks.setdefault(node, []).append(mark) |
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
158 for marks in nodetobookmarks.values(): |
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
159 if bookmarks.issuperset(marks): |
27030
cf9ed6d32ccb
strip: changing bookmark argument to be a list
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
27029
diff
changeset
|
160 rsrevs = repair.stripbmrevset(repo, marks[0]) |
cf9ed6d32ccb
strip: changing bookmark argument to be a list
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
27029
diff
changeset
|
161 revs.update(set(rsrevs)) |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
162 if not revs: |
27052
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
163 lock = tr = None |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
164 try: |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
165 lock = repo.lock() |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
166 tr = repo.transaction('bookmark') |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
167 for bookmark in bookmarks: |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
168 del repomarks[bookmark] |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
169 repomarks.recordchange(tr) |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
170 tr.close() |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
171 for bookmark in sorted(bookmarks): |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
172 ui.write(_("bookmark '%s' deleted\n") % bookmark) |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
173 finally: |
b9d0b45df7b2
strip: use repo._bookmarks.recordchange instead of repo._bookmarks.write
Laurent Charignon <lcharignon@fb.com>
parents:
27030
diff
changeset
|
174 release(lock, tr) |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
175 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
176 if not revs: |
26587
56b2bcea2529
error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25186
diff
changeset
|
177 raise error.Abort(_('empty revision set')) |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
178 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
179 descendants = set(cl.descendants(revs)) |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
180 strippedrevs = revs.union(descendants) |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
181 roots = revs.difference(descendants) |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
182 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
183 update = False |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
184 # if one of the wdir parent is stripped we'll need |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
185 # to update away to an earlier revision |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
186 for p in repo.dirstate.parents(): |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
187 if p != nullid and cl.rev(p) in strippedrevs: |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
188 update = True |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
189 break |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
190 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
191 rootnodes = set(cl.node(r) for r in roots) |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
192 |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
193 q = getattr(repo, 'mq', None) |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
194 if q is not None and q.applied: |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
195 # refresh queue state if we're about to strip |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
196 # applied patches |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
197 if cl.rev(repo.lookup('qtip')) in strippedrevs: |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
198 q.applieddirty = True |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
199 start = 0 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
200 end = len(q.applied) |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
201 for i, statusentry in enumerate(q.applied): |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
202 if statusentry.node in rootnodes: |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
203 # if one of the stripped roots is an applied |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
204 # patch, only part of the queue is stripped |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
205 start = i |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
206 break |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
207 del q.applied[start:end] |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
208 q.savedirty() |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
209 |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
210 revs = sorted(rootnodes) |
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
211 if update and opts.get('keep'): |
20102
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
212 urev, p2 = repo.changelog.parents(revs[0]) |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
213 if (util.safehasattr(repo, 'mq') and p2 != nullid |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
214 and p2 in [x.node for x in repo.mq.applied]): |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
215 urev = p2 |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
216 uctx = repo[urev] |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
217 |
20102
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
218 # only reset the dirstate for files that would actually change |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
219 # between the working context and uctx |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
220 descendantrevs = repo.revs("%s::." % uctx.rev()) |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
221 changedfiles = [] |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
222 for rev in descendantrevs: |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
223 # blindly reset the files, regardless of what actually changed |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
224 changedfiles.extend(repo[rev].files()) |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
225 |
20102
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
226 # reset files that only changed in the dirstate too |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
227 dirstate = repo.dirstate |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
228 dirchanges = [f for f in dirstate if dirstate[f] != 'n'] |
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
229 changedfiles.extend(dirchanges) |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
230 |
20102
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
231 repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) |
26748
5ba0a99ff27f
dirstate: make dirstate.write() callers pass transaction object to it
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
26624
diff
changeset
|
232 repo.dirstate.write(repo.currenttransaction()) |
24709
69154e0ae384
strip: properly clear resolve state with --keep (issue4593)
Matt Mackall <mpm@selenic.com>
parents:
24471
diff
changeset
|
233 |
69154e0ae384
strip: properly clear resolve state with --keep (issue4593)
Matt Mackall <mpm@selenic.com>
parents:
24471
diff
changeset
|
234 # clear resolve state |
26988
7e38d49bc713
strip: switch to mergestate.clean()
Siddharth Agarwal <sid0@fb.com>
parents:
26972
diff
changeset
|
235 merge.mergestate.clean(repo, repo['.'].node()) |
24709
69154e0ae384
strip: properly clear resolve state with --keep (issue4593)
Matt Mackall <mpm@selenic.com>
parents:
24471
diff
changeset
|
236 |
20102
04eaa8eec6a0
strip.stripcmd: remove redundant wlock acquire/release
Siddharth Agarwal <sid0@fb.com>
parents:
20101
diff
changeset
|
237 update = False |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
238 |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
239 |
20096
88e172871ad7
strip: hold wlock for entire duration
Siddharth Agarwal <sid0@fb.com>
parents:
20009
diff
changeset
|
240 strip(ui, repo, revs, backup=backup, update=update, |
27029
8279c5d116a0
strip: strip a list of bookmarks
Shubhanshu Agrawal <agrawal.shubhanshu@gmail.com>
parents:
26988
diff
changeset
|
241 force=opts.get('force'), bookmarks=bookmarks) |
19826
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
242 |
4b1cbcfdabf7
mq: extract strip function as its standalone extension (issue3824)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
19825
diff
changeset
|
243 return 0 |