Show More
@@ -1,222 +1,219 b'' | |||||
1 | """strip changesets and their descendents from history |
|
1 | """strip changesets and their descendents from history | |
2 |
|
2 | |||
3 | This extension allows you to strip changesets and all their descendants from the |
|
3 | This extension allows you to strip changesets and all their descendants from the | |
4 | repository. See the command help for details. |
|
4 | repository. See the command help for details. | |
5 | """ |
|
5 | """ | |
6 | from mercurial.i18n import _ |
|
6 | from mercurial.i18n import _ | |
7 | from mercurial.node import nullid |
|
7 | from mercurial.node import nullid | |
8 | from mercurial.lock import release |
|
8 | from mercurial.lock import release | |
9 | from mercurial import cmdutil, hg, scmutil, util |
|
9 | from mercurial import cmdutil, hg, scmutil, util | |
10 | from mercurial import repair, bookmarks |
|
10 | from mercurial import repair, bookmarks | |
11 |
|
11 | |||
12 | cmdtable = {} |
|
12 | cmdtable = {} | |
13 | command = cmdutil.command(cmdtable) |
|
13 | command = cmdutil.command(cmdtable) | |
14 | testedwith = 'internal' |
|
14 | testedwith = 'internal' | |
15 |
|
15 | |||
16 | def checksubstate(repo, baserev=None): |
|
16 | def checksubstate(repo, baserev=None): | |
17 | '''return list of subrepos at a different revision than substate. |
|
17 | '''return list of subrepos at a different revision than substate. | |
18 | Abort if any subrepos have uncommitted changes.''' |
|
18 | Abort if any subrepos have uncommitted changes.''' | |
19 | inclsubs = [] |
|
19 | inclsubs = [] | |
20 | wctx = repo[None] |
|
20 | wctx = repo[None] | |
21 | if baserev: |
|
21 | if baserev: | |
22 | bctx = repo[baserev] |
|
22 | bctx = repo[baserev] | |
23 | else: |
|
23 | else: | |
24 | bctx = wctx.parents()[0] |
|
24 | bctx = wctx.parents()[0] | |
25 | for s in sorted(wctx.substate): |
|
25 | for s in sorted(wctx.substate): | |
26 | if wctx.sub(s).dirty(True): |
|
26 | if wctx.sub(s).dirty(True): | |
27 | raise util.Abort( |
|
27 | raise util.Abort( | |
28 | _("uncommitted changes in subrepository %s") % s) |
|
28 | _("uncommitted changes in subrepository %s") % s) | |
29 | elif s not in bctx.substate or bctx.sub(s).dirty(): |
|
29 | elif s not in bctx.substate or bctx.sub(s).dirty(): | |
30 | inclsubs.append(s) |
|
30 | inclsubs.append(s) | |
31 | return inclsubs |
|
31 | return inclsubs | |
32 |
|
32 | |||
33 | def checklocalchanges(repo, force=False, excsuffix=''): |
|
33 | def checklocalchanges(repo, force=False, excsuffix=''): | |
34 | cmdutil.checkunfinished(repo) |
|
34 | cmdutil.checkunfinished(repo) | |
35 | m, a, r, d = repo.status()[:4] |
|
35 | m, a, r, d = repo.status()[:4] | |
36 | if not force: |
|
36 | if not force: | |
37 | if (m or a or r or d): |
|
37 | if (m or a or r or d): | |
38 | _("local changes found") # i18n tool detection |
|
38 | _("local changes found") # i18n tool detection | |
39 | raise util.Abort(_("local changes found" + excsuffix)) |
|
39 | raise util.Abort(_("local changes found" + excsuffix)) | |
40 | if checksubstate(repo): |
|
40 | if checksubstate(repo): | |
41 | _("local changed subrepos found") # i18n tool detection |
|
41 | _("local changed subrepos found") # i18n tool detection | |
42 | raise util.Abort(_("local changed subrepos found" + excsuffix)) |
|
42 | raise util.Abort(_("local changed subrepos found" + excsuffix)) | |
43 | return m, a, r, d |
|
43 | return m, a, r, d | |
44 |
|
44 | |||
45 | def strip(ui, repo, revs, update=True, backup="all", force=None, bookmark=None): |
|
45 | def strip(ui, repo, revs, update=True, backup="all", force=None, bookmark=None): | |
46 | wlock = lock = None |
|
46 | wlock = lock = None | |
47 | try: |
|
47 | try: | |
48 | wlock = repo.wlock() |
|
48 | wlock = repo.wlock() | |
49 | lock = repo.lock() |
|
49 | lock = repo.lock() | |
50 |
|
50 | |||
51 | if update: |
|
51 | if update: | |
52 | checklocalchanges(repo, force=force) |
|
52 | checklocalchanges(repo, force=force) | |
53 | urev, p2 = repo.changelog.parents(revs[0]) |
|
53 | urev, p2 = repo.changelog.parents(revs[0]) | |
54 | if (util.safehasattr(repo, 'mq') and |
|
54 | if (util.safehasattr(repo, 'mq') and | |
55 | p2 != nullid |
|
55 | p2 != nullid | |
56 | and p2 in [x.node for x in repo.mq.applied]): |
|
56 | and p2 in [x.node for x in repo.mq.applied]): | |
57 | urev = p2 |
|
57 | urev = p2 | |
58 | hg.clean(repo, urev) |
|
58 | hg.clean(repo, urev) | |
59 | repo.dirstate.write() |
|
59 | repo.dirstate.write() | |
60 |
|
60 | |||
61 | repair.strip(ui, repo, revs, backup) |
|
61 | repair.strip(ui, repo, revs, backup) | |
62 |
|
62 | |||
63 | marks = repo._bookmarks |
|
63 | marks = repo._bookmarks | |
64 | if bookmark: |
|
64 | if bookmark: | |
65 | if bookmark == repo._bookmarkcurrent: |
|
65 | if bookmark == repo._bookmarkcurrent: | |
66 | bookmarks.unsetcurrent(repo) |
|
66 | bookmarks.unsetcurrent(repo) | |
67 | del marks[bookmark] |
|
67 | del marks[bookmark] | |
68 | marks.write() |
|
68 | marks.write() | |
69 | ui.write(_("bookmark '%s' deleted\n") % bookmark) |
|
69 | ui.write(_("bookmark '%s' deleted\n") % bookmark) | |
70 | finally: |
|
70 | finally: | |
71 | release(lock, wlock) |
|
71 | release(lock, wlock) | |
72 |
|
72 | |||
73 |
|
73 | |||
74 | @command("strip", |
|
74 | @command("strip", | |
75 | [ |
|
75 | [ | |
76 | ('r', 'rev', [], _('strip specified revision (optional, ' |
|
76 | ('r', 'rev', [], _('strip specified revision (optional, ' | |
77 | 'can specify revisions without this ' |
|
77 | 'can specify revisions without this ' | |
78 | 'option)'), _('REV')), |
|
78 | 'option)'), _('REV')), | |
79 | ('f', 'force', None, _('force removal of changesets, discard ' |
|
79 | ('f', 'force', None, _('force removal of changesets, discard ' | |
80 | 'uncommitted changes (no backup)')), |
|
80 | 'uncommitted changes (no backup)')), | |
81 | ('b', 'backup', None, _('bundle only changesets with local revision' |
|
|||
82 | ' number greater than REV which are not' |
|
|||
83 | ' descendants of REV (DEPRECATED)')), |
|
|||
84 | ('', 'no-backup', None, _('no backups')), |
|
81 | ('', 'no-backup', None, _('no backups')), | |
85 | ('', 'nobackup', None, _('no backups (DEPRECATED)')), |
|
82 | ('', 'nobackup', None, _('no backups (DEPRECATED)')), | |
86 | ('n', '', None, _('ignored (DEPRECATED)')), |
|
83 | ('n', '', None, _('ignored (DEPRECATED)')), | |
87 | ('k', 'keep', None, _("do not modify working copy during strip")), |
|
84 | ('k', 'keep', None, _("do not modify working copy during strip")), | |
88 | ('B', 'bookmark', '', _("remove revs only reachable from given" |
|
85 | ('B', 'bookmark', '', _("remove revs only reachable from given" | |
89 | " bookmark"))], |
|
86 | " bookmark"))], | |
90 | _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...')) |
|
87 | _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...')) | |
91 | def stripcmd(ui, repo, *revs, **opts): |
|
88 | def stripcmd(ui, repo, *revs, **opts): | |
92 | """strip changesets and all their descendants from the repository |
|
89 | """strip changesets and all their descendants from the repository | |
93 |
|
90 | |||
94 | The strip command removes the specified changesets and all their |
|
91 | The strip command removes the specified changesets and all their | |
95 | descendants. If the working directory has uncommitted changes, the |
|
92 | descendants. If the working directory has uncommitted changes, the | |
96 | operation is aborted unless the --force flag is supplied, in which |
|
93 | operation is aborted unless the --force flag is supplied, in which | |
97 | case changes will be discarded. |
|
94 | case changes will be discarded. | |
98 |
|
95 | |||
99 | If a parent of the working directory is stripped, then the working |
|
96 | If a parent of the working directory is stripped, then the working | |
100 | directory will automatically be updated to the most recent |
|
97 | directory will automatically be updated to the most recent | |
101 | available ancestor of the stripped parent after the operation |
|
98 | available ancestor of the stripped parent after the operation | |
102 | completes. |
|
99 | completes. | |
103 |
|
100 | |||
104 | Any stripped changesets are stored in ``.hg/strip-backup`` as a |
|
101 | Any stripped changesets are stored in ``.hg/strip-backup`` as a | |
105 | bundle (see :hg:`help bundle` and :hg:`help unbundle`). They can |
|
102 | bundle (see :hg:`help bundle` and :hg:`help unbundle`). They can | |
106 | be restored by running :hg:`unbundle .hg/strip-backup/BUNDLE`, |
|
103 | be restored by running :hg:`unbundle .hg/strip-backup/BUNDLE`, | |
107 | where BUNDLE is the bundle file created by the strip. Note that |
|
104 | where BUNDLE is the bundle file created by the strip. Note that | |
108 | the local revision numbers will in general be different after the |
|
105 | the local revision numbers will in general be different after the | |
109 | restore. |
|
106 | restore. | |
110 |
|
107 | |||
111 | Use the --no-backup option to discard the backup bundle once the |
|
108 | Use the --no-backup option to discard the backup bundle once the | |
112 | operation completes. |
|
109 | operation completes. | |
113 |
|
110 | |||
114 | Strip is not a history-rewriting operation and can be used on |
|
111 | Strip is not a history-rewriting operation and can be used on | |
115 | changesets in the public phase. But if the stripped changesets have |
|
112 | changesets in the public phase. But if the stripped changesets have | |
116 | been pushed to a remote repository you will likely pull them again. |
|
113 | been pushed to a remote repository you will likely pull them again. | |
117 |
|
114 | |||
118 | Return 0 on success. |
|
115 | Return 0 on success. | |
119 | """ |
|
116 | """ | |
120 | backup = 'all' |
|
117 | backup = 'all' | |
121 | if opts.get('backup'): |
|
118 | if opts.get('backup'): | |
122 | backup = 'strip' |
|
119 | backup = 'strip' | |
123 | elif opts.get('no_backup') or opts.get('nobackup'): |
|
120 | elif opts.get('no_backup') or opts.get('nobackup'): | |
124 | backup = 'none' |
|
121 | backup = 'none' | |
125 |
|
122 | |||
126 | cl = repo.changelog |
|
123 | cl = repo.changelog | |
127 | revs = list(revs) + opts.get('rev') |
|
124 | revs = list(revs) + opts.get('rev') | |
128 | revs = set(scmutil.revrange(repo, revs)) |
|
125 | revs = set(scmutil.revrange(repo, revs)) | |
129 |
|
126 | |||
130 | wlock = repo.wlock() |
|
127 | wlock = repo.wlock() | |
131 | try: |
|
128 | try: | |
132 | if opts.get('bookmark'): |
|
129 | if opts.get('bookmark'): | |
133 | mark = opts.get('bookmark') |
|
130 | mark = opts.get('bookmark') | |
134 | marks = repo._bookmarks |
|
131 | marks = repo._bookmarks | |
135 | if mark not in marks: |
|
132 | if mark not in marks: | |
136 | raise util.Abort(_("bookmark '%s' not found") % mark) |
|
133 | raise util.Abort(_("bookmark '%s' not found") % mark) | |
137 |
|
134 | |||
138 | # If the requested bookmark is not the only one pointing to a |
|
135 | # If the requested bookmark is not the only one pointing to a | |
139 | # a revision we have to only delete the bookmark and not strip |
|
136 | # a revision we have to only delete the bookmark and not strip | |
140 | # anything. revsets cannot detect that case. |
|
137 | # anything. revsets cannot detect that case. | |
141 | uniquebm = True |
|
138 | uniquebm = True | |
142 | for m, n in marks.iteritems(): |
|
139 | for m, n in marks.iteritems(): | |
143 | if m != mark and n == repo[mark].node(): |
|
140 | if m != mark and n == repo[mark].node(): | |
144 | uniquebm = False |
|
141 | uniquebm = False | |
145 | break |
|
142 | break | |
146 | if uniquebm: |
|
143 | if uniquebm: | |
147 | rsrevs = repo.revs("ancestors(bookmark(%s)) - " |
|
144 | rsrevs = repo.revs("ancestors(bookmark(%s)) - " | |
148 | "ancestors(head() and not bookmark(%s)) - " |
|
145 | "ancestors(head() and not bookmark(%s)) - " | |
149 | "ancestors(bookmark() and not bookmark(%s))", |
|
146 | "ancestors(bookmark() and not bookmark(%s))", | |
150 | mark, mark, mark) |
|
147 | mark, mark, mark) | |
151 | revs.update(set(rsrevs)) |
|
148 | revs.update(set(rsrevs)) | |
152 | if not revs: |
|
149 | if not revs: | |
153 | del marks[mark] |
|
150 | del marks[mark] | |
154 | marks.write() |
|
151 | marks.write() | |
155 | ui.write(_("bookmark '%s' deleted\n") % mark) |
|
152 | ui.write(_("bookmark '%s' deleted\n") % mark) | |
156 |
|
153 | |||
157 | if not revs: |
|
154 | if not revs: | |
158 | raise util.Abort(_('empty revision set')) |
|
155 | raise util.Abort(_('empty revision set')) | |
159 |
|
156 | |||
160 | descendants = set(cl.descendants(revs)) |
|
157 | descendants = set(cl.descendants(revs)) | |
161 | strippedrevs = revs.union(descendants) |
|
158 | strippedrevs = revs.union(descendants) | |
162 | roots = revs.difference(descendants) |
|
159 | roots = revs.difference(descendants) | |
163 |
|
160 | |||
164 | update = False |
|
161 | update = False | |
165 | # if one of the wdir parent is stripped we'll need |
|
162 | # if one of the wdir parent is stripped we'll need | |
166 | # to update away to an earlier revision |
|
163 | # to update away to an earlier revision | |
167 | for p in repo.dirstate.parents(): |
|
164 | for p in repo.dirstate.parents(): | |
168 | if p != nullid and cl.rev(p) in strippedrevs: |
|
165 | if p != nullid and cl.rev(p) in strippedrevs: | |
169 | update = True |
|
166 | update = True | |
170 | break |
|
167 | break | |
171 |
|
168 | |||
172 | rootnodes = set(cl.node(r) for r in roots) |
|
169 | rootnodes = set(cl.node(r) for r in roots) | |
173 |
|
170 | |||
174 | q = getattr(repo, 'mq', None) |
|
171 | q = getattr(repo, 'mq', None) | |
175 | if q is not None and q.applied: |
|
172 | if q is not None and q.applied: | |
176 | # refresh queue state if we're about to strip |
|
173 | # refresh queue state if we're about to strip | |
177 | # applied patches |
|
174 | # applied patches | |
178 | if cl.rev(repo.lookup('qtip')) in strippedrevs: |
|
175 | if cl.rev(repo.lookup('qtip')) in strippedrevs: | |
179 | q.applieddirty = True |
|
176 | q.applieddirty = True | |
180 | start = 0 |
|
177 | start = 0 | |
181 | end = len(q.applied) |
|
178 | end = len(q.applied) | |
182 | for i, statusentry in enumerate(q.applied): |
|
179 | for i, statusentry in enumerate(q.applied): | |
183 | if statusentry.node in rootnodes: |
|
180 | if statusentry.node in rootnodes: | |
184 | # if one of the stripped roots is an applied |
|
181 | # if one of the stripped roots is an applied | |
185 | # patch, only part of the queue is stripped |
|
182 | # patch, only part of the queue is stripped | |
186 | start = i |
|
183 | start = i | |
187 | break |
|
184 | break | |
188 | del q.applied[start:end] |
|
185 | del q.applied[start:end] | |
189 | q.savedirty() |
|
186 | q.savedirty() | |
190 |
|
187 | |||
191 | revs = sorted(rootnodes) |
|
188 | revs = sorted(rootnodes) | |
192 | if update and opts.get('keep'): |
|
189 | if update and opts.get('keep'): | |
193 | urev, p2 = repo.changelog.parents(revs[0]) |
|
190 | urev, p2 = repo.changelog.parents(revs[0]) | |
194 | if (util.safehasattr(repo, 'mq') and p2 != nullid |
|
191 | if (util.safehasattr(repo, 'mq') and p2 != nullid | |
195 | and p2 in [x.node for x in repo.mq.applied]): |
|
192 | and p2 in [x.node for x in repo.mq.applied]): | |
196 | urev = p2 |
|
193 | urev = p2 | |
197 | uctx = repo[urev] |
|
194 | uctx = repo[urev] | |
198 |
|
195 | |||
199 | # only reset the dirstate for files that would actually change |
|
196 | # only reset the dirstate for files that would actually change | |
200 | # between the working context and uctx |
|
197 | # between the working context and uctx | |
201 | descendantrevs = repo.revs("%s::." % uctx.rev()) |
|
198 | descendantrevs = repo.revs("%s::." % uctx.rev()) | |
202 | changedfiles = [] |
|
199 | changedfiles = [] | |
203 | for rev in descendantrevs: |
|
200 | for rev in descendantrevs: | |
204 | # blindly reset the files, regardless of what actually changed |
|
201 | # blindly reset the files, regardless of what actually changed | |
205 | changedfiles.extend(repo[rev].files()) |
|
202 | changedfiles.extend(repo[rev].files()) | |
206 |
|
203 | |||
207 | # reset files that only changed in the dirstate too |
|
204 | # reset files that only changed in the dirstate too | |
208 | dirstate = repo.dirstate |
|
205 | dirstate = repo.dirstate | |
209 | dirchanges = [f for f in dirstate if dirstate[f] != 'n'] |
|
206 | dirchanges = [f for f in dirstate if dirstate[f] != 'n'] | |
210 | changedfiles.extend(dirchanges) |
|
207 | changedfiles.extend(dirchanges) | |
211 |
|
208 | |||
212 | repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) |
|
209 | repo.dirstate.rebuild(urev, uctx.manifest(), changedfiles) | |
213 | repo.dirstate.write() |
|
210 | repo.dirstate.write() | |
214 | update = False |
|
211 | update = False | |
215 |
|
212 | |||
216 |
|
213 | |||
217 | strip(ui, repo, revs, backup=backup, update=update, |
|
214 | strip(ui, repo, revs, backup=backup, update=update, | |
218 | force=opts.get('force'), bookmark=opts.get('bookmark')) |
|
215 | force=opts.get('force'), bookmark=opts.get('bookmark')) | |
219 | finally: |
|
216 | finally: | |
220 | wlock.release() |
|
217 | wlock.release() | |
221 |
|
218 | |||
222 | return 0 |
|
219 | return 0 |
@@ -1,527 +1,551 b'' | |||||
1 | $ echo "[extensions]" >> $HGRCPATH |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
2 | $ echo "strip=" >> $HGRCPATH |
|
2 | $ echo "strip=" >> $HGRCPATH | |
3 |
|
3 | |||
4 | $ restore() { |
|
4 | $ restore() { | |
5 | > hg unbundle -q .hg/strip-backup/* |
|
5 | > hg unbundle -q .hg/strip-backup/* | |
6 | > rm .hg/strip-backup/* |
|
6 | > rm .hg/strip-backup/* | |
7 | > } |
|
7 | > } | |
8 | $ teststrip() { |
|
8 | $ teststrip() { | |
9 | > hg up -C $1 |
|
9 | > hg up -C $1 | |
10 | > echo % before update $1, strip $2 |
|
10 | > echo % before update $1, strip $2 | |
11 | > hg parents |
|
11 | > hg parents | |
12 | > hg --traceback strip $2 |
|
12 | > hg --traceback strip $2 | |
13 | > echo % after update $1, strip $2 |
|
13 | > echo % after update $1, strip $2 | |
14 | > hg parents |
|
14 | > hg parents | |
15 | > restore |
|
15 | > restore | |
16 | > } |
|
16 | > } | |
17 |
|
17 | |||
18 | $ hg init test |
|
18 | $ hg init test | |
19 | $ cd test |
|
19 | $ cd test | |
20 |
|
20 | |||
21 | $ echo foo > bar |
|
21 | $ echo foo > bar | |
22 | $ hg ci -Ama |
|
22 | $ hg ci -Ama | |
23 | adding bar |
|
23 | adding bar | |
24 |
|
24 | |||
25 | $ echo more >> bar |
|
25 | $ echo more >> bar | |
26 | $ hg ci -Amb |
|
26 | $ hg ci -Amb | |
27 |
|
27 | |||
28 | $ echo blah >> bar |
|
28 | $ echo blah >> bar | |
29 | $ hg ci -Amc |
|
29 | $ hg ci -Amc | |
30 |
|
30 | |||
31 | $ hg up 1 |
|
31 | $ hg up 1 | |
32 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
32 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
33 | $ echo blah >> bar |
|
33 | $ echo blah >> bar | |
34 | $ hg ci -Amd |
|
34 | $ hg ci -Amd | |
35 | created new head |
|
35 | created new head | |
36 |
|
36 | |||
37 | $ echo final >> bar |
|
37 | $ echo final >> bar | |
38 | $ hg ci -Ame |
|
38 | $ hg ci -Ame | |
39 |
|
39 | |||
40 | $ hg log |
|
40 | $ hg log | |
41 | changeset: 4:443431ffac4f |
|
41 | changeset: 4:443431ffac4f | |
42 | tag: tip |
|
42 | tag: tip | |
43 | user: test |
|
43 | user: test | |
44 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
44 | date: Thu Jan 01 00:00:00 1970 +0000 | |
45 | summary: e |
|
45 | summary: e | |
46 |
|
46 | |||
47 | changeset: 3:65bd5f99a4a3 |
|
47 | changeset: 3:65bd5f99a4a3 | |
48 | parent: 1:ef3a871183d7 |
|
48 | parent: 1:ef3a871183d7 | |
49 | user: test |
|
49 | user: test | |
50 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | date: Thu Jan 01 00:00:00 1970 +0000 | |
51 | summary: d |
|
51 | summary: d | |
52 |
|
52 | |||
53 | changeset: 2:264128213d29 |
|
53 | changeset: 2:264128213d29 | |
54 | user: test |
|
54 | user: test | |
55 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | date: Thu Jan 01 00:00:00 1970 +0000 | |
56 | summary: c |
|
56 | summary: c | |
57 |
|
57 | |||
58 | changeset: 1:ef3a871183d7 |
|
58 | changeset: 1:ef3a871183d7 | |
59 | user: test |
|
59 | user: test | |
60 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | date: Thu Jan 01 00:00:00 1970 +0000 | |
61 | summary: b |
|
61 | summary: b | |
62 |
|
62 | |||
63 | changeset: 0:9ab35a2d17cb |
|
63 | changeset: 0:9ab35a2d17cb | |
64 | user: test |
|
64 | user: test | |
65 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 | date: Thu Jan 01 00:00:00 1970 +0000 | |
66 | summary: a |
|
66 | summary: a | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | $ teststrip 4 4 |
|
69 | $ teststrip 4 4 | |
70 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
71 | % before update 4, strip 4 |
|
71 | % before update 4, strip 4 | |
72 | changeset: 4:443431ffac4f |
|
72 | changeset: 4:443431ffac4f | |
73 | tag: tip |
|
73 | tag: tip | |
74 | user: test |
|
74 | user: test | |
75 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
75 | date: Thu Jan 01 00:00:00 1970 +0000 | |
76 | summary: e |
|
76 | summary: e | |
77 |
|
77 | |||
78 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
79 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
79 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
80 | % after update 4, strip 4 |
|
80 | % after update 4, strip 4 | |
81 | changeset: 3:65bd5f99a4a3 |
|
81 | changeset: 3:65bd5f99a4a3 | |
82 | tag: tip |
|
82 | tag: tip | |
83 | parent: 1:ef3a871183d7 |
|
83 | parent: 1:ef3a871183d7 | |
84 | user: test |
|
84 | user: test | |
85 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
85 | date: Thu Jan 01 00:00:00 1970 +0000 | |
86 | summary: d |
|
86 | summary: d | |
87 |
|
87 | |||
88 | $ teststrip 4 3 |
|
88 | $ teststrip 4 3 | |
89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
90 | % before update 4, strip 3 |
|
90 | % before update 4, strip 3 | |
91 | changeset: 4:443431ffac4f |
|
91 | changeset: 4:443431ffac4f | |
92 | tag: tip |
|
92 | tag: tip | |
93 | user: test |
|
93 | user: test | |
94 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
94 | date: Thu Jan 01 00:00:00 1970 +0000 | |
95 | summary: e |
|
95 | summary: e | |
96 |
|
96 | |||
97 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
98 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
98 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
99 | % after update 4, strip 3 |
|
99 | % after update 4, strip 3 | |
100 | changeset: 1:ef3a871183d7 |
|
100 | changeset: 1:ef3a871183d7 | |
101 | user: test |
|
101 | user: test | |
102 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
102 | date: Thu Jan 01 00:00:00 1970 +0000 | |
103 | summary: b |
|
103 | summary: b | |
104 |
|
104 | |||
105 | $ teststrip 1 4 |
|
105 | $ teststrip 1 4 | |
106 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
106 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 | % before update 1, strip 4 |
|
107 | % before update 1, strip 4 | |
108 | changeset: 1:ef3a871183d7 |
|
108 | changeset: 1:ef3a871183d7 | |
109 | user: test |
|
109 | user: test | |
110 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
110 | date: Thu Jan 01 00:00:00 1970 +0000 | |
111 | summary: b |
|
111 | summary: b | |
112 |
|
112 | |||
113 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
113 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
114 | % after update 1, strip 4 |
|
114 | % after update 1, strip 4 | |
115 | changeset: 1:ef3a871183d7 |
|
115 | changeset: 1:ef3a871183d7 | |
116 | user: test |
|
116 | user: test | |
117 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
117 | date: Thu Jan 01 00:00:00 1970 +0000 | |
118 | summary: b |
|
118 | summary: b | |
119 |
|
119 | |||
120 | $ teststrip 4 2 |
|
120 | $ teststrip 4 2 | |
121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 | % before update 4, strip 2 |
|
122 | % before update 4, strip 2 | |
123 | changeset: 4:443431ffac4f |
|
123 | changeset: 4:443431ffac4f | |
124 | tag: tip |
|
124 | tag: tip | |
125 | user: test |
|
125 | user: test | |
126 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
126 | date: Thu Jan 01 00:00:00 1970 +0000 | |
127 | summary: e |
|
127 | summary: e | |
128 |
|
128 | |||
129 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
129 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
130 | % after update 4, strip 2 |
|
130 | % after update 4, strip 2 | |
131 | changeset: 3:443431ffac4f |
|
131 | changeset: 3:443431ffac4f | |
132 | tag: tip |
|
132 | tag: tip | |
133 | user: test |
|
133 | user: test | |
134 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
134 | date: Thu Jan 01 00:00:00 1970 +0000 | |
135 | summary: e |
|
135 | summary: e | |
136 |
|
136 | |||
137 | $ teststrip 4 1 |
|
137 | $ teststrip 4 1 | |
138 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
138 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
139 | % before update 4, strip 1 |
|
139 | % before update 4, strip 1 | |
140 | changeset: 4:264128213d29 |
|
140 | changeset: 4:264128213d29 | |
141 | tag: tip |
|
141 | tag: tip | |
142 | parent: 1:ef3a871183d7 |
|
142 | parent: 1:ef3a871183d7 | |
143 | user: test |
|
143 | user: test | |
144 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
144 | date: Thu Jan 01 00:00:00 1970 +0000 | |
145 | summary: c |
|
145 | summary: c | |
146 |
|
146 | |||
147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
147 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
148 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
148 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
149 | % after update 4, strip 1 |
|
149 | % after update 4, strip 1 | |
150 | changeset: 0:9ab35a2d17cb |
|
150 | changeset: 0:9ab35a2d17cb | |
151 | tag: tip |
|
151 | tag: tip | |
152 | user: test |
|
152 | user: test | |
153 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
153 | date: Thu Jan 01 00:00:00 1970 +0000 | |
154 | summary: a |
|
154 | summary: a | |
155 |
|
155 | |||
156 | $ teststrip null 4 |
|
156 | $ teststrip null 4 | |
157 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
157 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
158 | % before update null, strip 4 |
|
158 | % before update null, strip 4 | |
159 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
159 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
160 | % after update null, strip 4 |
|
160 | % after update null, strip 4 | |
161 |
|
161 | |||
162 | $ hg log |
|
162 | $ hg log | |
163 | changeset: 4:264128213d29 |
|
163 | changeset: 4:264128213d29 | |
164 | tag: tip |
|
164 | tag: tip | |
165 | parent: 1:ef3a871183d7 |
|
165 | parent: 1:ef3a871183d7 | |
166 | user: test |
|
166 | user: test | |
167 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
167 | date: Thu Jan 01 00:00:00 1970 +0000 | |
168 | summary: c |
|
168 | summary: c | |
169 |
|
169 | |||
170 | changeset: 3:443431ffac4f |
|
170 | changeset: 3:443431ffac4f | |
171 | user: test |
|
171 | user: test | |
172 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
172 | date: Thu Jan 01 00:00:00 1970 +0000 | |
173 | summary: e |
|
173 | summary: e | |
174 |
|
174 | |||
175 | changeset: 2:65bd5f99a4a3 |
|
175 | changeset: 2:65bd5f99a4a3 | |
176 | user: test |
|
176 | user: test | |
177 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
177 | date: Thu Jan 01 00:00:00 1970 +0000 | |
178 | summary: d |
|
178 | summary: d | |
179 |
|
179 | |||
180 | changeset: 1:ef3a871183d7 |
|
180 | changeset: 1:ef3a871183d7 | |
181 | user: test |
|
181 | user: test | |
182 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
182 | date: Thu Jan 01 00:00:00 1970 +0000 | |
183 | summary: b |
|
183 | summary: b | |
184 |
|
184 | |||
185 | changeset: 0:9ab35a2d17cb |
|
185 | changeset: 0:9ab35a2d17cb | |
186 | user: test |
|
186 | user: test | |
187 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
187 | date: Thu Jan 01 00:00:00 1970 +0000 | |
188 | summary: a |
|
188 | summary: a | |
189 |
|
189 | |||
190 |
|
190 | |||
191 | $ hg up -C 2 |
|
191 | $ hg up -C 2 | |
192 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
192 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
193 | $ hg merge 4 |
|
193 | $ hg merge 4 | |
194 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
194 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
195 | (branch merge, don't forget to commit) |
|
195 | (branch merge, don't forget to commit) | |
196 |
|
196 | |||
197 | before strip of merge parent |
|
197 | before strip of merge parent | |
198 |
|
198 | |||
199 | $ hg parents |
|
199 | $ hg parents | |
200 | changeset: 2:65bd5f99a4a3 |
|
200 | changeset: 2:65bd5f99a4a3 | |
201 | user: test |
|
201 | user: test | |
202 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
202 | date: Thu Jan 01 00:00:00 1970 +0000 | |
203 | summary: d |
|
203 | summary: d | |
204 |
|
204 | |||
205 | changeset: 4:264128213d29 |
|
205 | changeset: 4:264128213d29 | |
206 | tag: tip |
|
206 | tag: tip | |
207 | parent: 1:ef3a871183d7 |
|
207 | parent: 1:ef3a871183d7 | |
208 | user: test |
|
208 | user: test | |
209 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
209 | date: Thu Jan 01 00:00:00 1970 +0000 | |
210 | summary: c |
|
210 | summary: c | |
211 |
|
211 | |||
212 | $ hg strip 4 |
|
212 | $ hg strip 4 | |
213 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
213 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
214 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
214 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
215 |
|
215 | |||
216 | after strip of merge parent |
|
216 | after strip of merge parent | |
217 |
|
217 | |||
218 | $ hg parents |
|
218 | $ hg parents | |
219 | changeset: 1:ef3a871183d7 |
|
219 | changeset: 1:ef3a871183d7 | |
220 | user: test |
|
220 | user: test | |
221 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
221 | date: Thu Jan 01 00:00:00 1970 +0000 | |
222 | summary: b |
|
222 | summary: b | |
223 |
|
223 | |||
224 | $ restore |
|
224 | $ restore | |
225 |
|
225 | |||
226 | $ hg up |
|
226 | $ hg up | |
227 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
227 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
228 | $ hg log -G |
|
228 | $ hg log -G | |
229 | @ changeset: 4:264128213d29 |
|
229 | @ changeset: 4:264128213d29 | |
230 | | tag: tip |
|
230 | | tag: tip | |
231 | | parent: 1:ef3a871183d7 |
|
231 | | parent: 1:ef3a871183d7 | |
232 | | user: test |
|
232 | | user: test | |
233 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
233 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
234 | | summary: c |
|
234 | | summary: c | |
235 | | |
|
235 | | | |
236 | | o changeset: 3:443431ffac4f |
|
236 | | o changeset: 3:443431ffac4f | |
237 | | | user: test |
|
237 | | | user: test | |
238 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
238 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
239 | | | summary: e |
|
239 | | | summary: e | |
240 | | | |
|
240 | | | | |
241 | | o changeset: 2:65bd5f99a4a3 |
|
241 | | o changeset: 2:65bd5f99a4a3 | |
242 | |/ user: test |
|
242 | |/ user: test | |
243 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
243 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
244 | | summary: d |
|
244 | | summary: d | |
245 | | |
|
245 | | | |
246 | o changeset: 1:ef3a871183d7 |
|
246 | o changeset: 1:ef3a871183d7 | |
247 | | user: test |
|
247 | | user: test | |
248 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
248 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
249 | | summary: b |
|
249 | | summary: b | |
250 | | |
|
250 | | | |
251 | o changeset: 0:9ab35a2d17cb |
|
251 | o changeset: 0:9ab35a2d17cb | |
252 | user: test |
|
252 | user: test | |
253 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
253 | date: Thu Jan 01 00:00:00 1970 +0000 | |
254 | summary: a |
|
254 | summary: a | |
255 |
|
255 | |||
256 |
|
256 | |||
257 | 2 is parent of 3, only one strip should happen |
|
257 | 2 is parent of 3, only one strip should happen | |
258 |
|
258 | |||
259 | $ hg strip "roots(2)" 3 |
|
259 | $ hg strip "roots(2)" 3 | |
260 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
260 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
261 | $ hg log -G |
|
261 | $ hg log -G | |
262 | @ changeset: 2:264128213d29 |
|
262 | @ changeset: 2:264128213d29 | |
263 | | tag: tip |
|
263 | | tag: tip | |
264 | | user: test |
|
264 | | user: test | |
265 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
265 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
266 | | summary: c |
|
266 | | summary: c | |
267 | | |
|
267 | | | |
268 | o changeset: 1:ef3a871183d7 |
|
268 | o changeset: 1:ef3a871183d7 | |
269 | | user: test |
|
269 | | user: test | |
270 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
270 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
271 | | summary: b |
|
271 | | summary: b | |
272 | | |
|
272 | | | |
273 | o changeset: 0:9ab35a2d17cb |
|
273 | o changeset: 0:9ab35a2d17cb | |
274 | user: test |
|
274 | user: test | |
275 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
275 | date: Thu Jan 01 00:00:00 1970 +0000 | |
276 | summary: a |
|
276 | summary: a | |
277 |
|
277 | |||
278 | $ restore |
|
278 | $ restore | |
279 | $ hg log -G |
|
279 | $ hg log -G | |
280 | o changeset: 4:443431ffac4f |
|
280 | o changeset: 4:443431ffac4f | |
281 | | tag: tip |
|
281 | | tag: tip | |
282 | | user: test |
|
282 | | user: test | |
283 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
283 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
284 | | summary: e |
|
284 | | summary: e | |
285 | | |
|
285 | | | |
286 | o changeset: 3:65bd5f99a4a3 |
|
286 | o changeset: 3:65bd5f99a4a3 | |
287 | | parent: 1:ef3a871183d7 |
|
287 | | parent: 1:ef3a871183d7 | |
288 | | user: test |
|
288 | | user: test | |
289 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
289 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
290 | | summary: d |
|
290 | | summary: d | |
291 | | |
|
291 | | | |
292 | | @ changeset: 2:264128213d29 |
|
292 | | @ changeset: 2:264128213d29 | |
293 | |/ user: test |
|
293 | |/ user: test | |
294 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
294 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
295 | | summary: c |
|
295 | | summary: c | |
296 | | |
|
296 | | | |
297 | o changeset: 1:ef3a871183d7 |
|
297 | o changeset: 1:ef3a871183d7 | |
298 | | user: test |
|
298 | | user: test | |
299 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
299 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
300 | | summary: b |
|
300 | | summary: b | |
301 | | |
|
301 | | | |
302 | o changeset: 0:9ab35a2d17cb |
|
302 | o changeset: 0:9ab35a2d17cb | |
303 | user: test |
|
303 | user: test | |
304 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
304 | date: Thu Jan 01 00:00:00 1970 +0000 | |
305 | summary: a |
|
305 | summary: a | |
306 |
|
306 | |||
307 |
|
307 | |||
308 | 2 different branches: 2 strips |
|
308 | 2 different branches: 2 strips | |
309 |
|
309 | |||
310 | $ hg strip 2 4 |
|
310 | $ hg strip 2 4 | |
311 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
311 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
312 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
312 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
313 | $ hg log -G |
|
313 | $ hg log -G | |
314 | o changeset: 2:65bd5f99a4a3 |
|
314 | o changeset: 2:65bd5f99a4a3 | |
315 | | tag: tip |
|
315 | | tag: tip | |
316 | | user: test |
|
316 | | user: test | |
317 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
317 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
318 | | summary: d |
|
318 | | summary: d | |
319 | | |
|
319 | | | |
320 | @ changeset: 1:ef3a871183d7 |
|
320 | @ changeset: 1:ef3a871183d7 | |
321 | | user: test |
|
321 | | user: test | |
322 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
322 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
323 | | summary: b |
|
323 | | summary: b | |
324 | | |
|
324 | | | |
325 | o changeset: 0:9ab35a2d17cb |
|
325 | o changeset: 0:9ab35a2d17cb | |
326 | user: test |
|
326 | user: test | |
327 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
327 | date: Thu Jan 01 00:00:00 1970 +0000 | |
328 | summary: a |
|
328 | summary: a | |
329 |
|
329 | |||
330 | $ restore |
|
330 | $ restore | |
331 |
|
331 | |||
332 | 2 different branches and a common ancestor: 1 strip |
|
332 | 2 different branches and a common ancestor: 1 strip | |
333 |
|
333 | |||
334 | $ hg strip 1 "2|4" |
|
334 | $ hg strip 1 "2|4" | |
335 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
335 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
336 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
336 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
337 | $ restore |
|
337 | $ restore | |
338 |
|
338 | |||
339 | verify fncache is kept up-to-date |
|
339 | verify fncache is kept up-to-date | |
340 |
|
340 | |||
341 | $ touch a |
|
341 | $ touch a | |
342 | $ hg ci -qAm a |
|
342 | $ hg ci -qAm a | |
343 | $ cat .hg/store/fncache | sort |
|
343 | $ cat .hg/store/fncache | sort | |
344 | data/a.i |
|
344 | data/a.i | |
345 | data/bar.i |
|
345 | data/bar.i | |
346 | $ hg strip tip |
|
346 | $ hg strip tip | |
347 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
347 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
348 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
348 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
349 | $ cat .hg/store/fncache |
|
349 | $ cat .hg/store/fncache | |
350 | data/bar.i |
|
350 | data/bar.i | |
351 |
|
351 | |||
352 | stripping an empty revset |
|
352 | stripping an empty revset | |
353 |
|
353 | |||
354 | $ hg strip "1 and not 1" |
|
354 | $ hg strip "1 and not 1" | |
355 | abort: empty revision set |
|
355 | abort: empty revision set | |
356 | [255] |
|
356 | [255] | |
357 |
|
357 | |||
358 | remove branchy history for qimport tests |
|
358 | remove branchy history for qimport tests | |
359 |
|
359 | |||
360 | $ hg strip 3 |
|
360 | $ hg strip 3 | |
361 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
361 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
362 |
|
362 | |||
363 |
|
363 | |||
364 | strip of applied mq should cleanup status file |
|
364 | strip of applied mq should cleanup status file | |
365 |
|
365 | |||
366 | $ echo "mq=" >> $HGRCPATH |
|
366 | $ echo "mq=" >> $HGRCPATH | |
367 | $ hg up -C 3 |
|
367 | $ hg up -C 3 | |
368 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
368 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
369 | $ echo fooagain >> bar |
|
369 | $ echo fooagain >> bar | |
370 | $ hg ci -mf |
|
370 | $ hg ci -mf | |
371 | $ hg qimport -r tip:2 |
|
371 | $ hg qimport -r tip:2 | |
372 |
|
372 | |||
373 | applied patches before strip |
|
373 | applied patches before strip | |
374 |
|
374 | |||
375 | $ hg qapplied |
|
375 | $ hg qapplied | |
376 | 2.diff |
|
376 | 2.diff | |
377 | 3.diff |
|
377 | 3.diff | |
378 | 4.diff |
|
378 | 4.diff | |
379 |
|
379 | |||
380 | stripping revision in queue |
|
380 | stripping revision in queue | |
381 |
|
381 | |||
382 | $ hg strip 3 |
|
382 | $ hg strip 3 | |
383 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
383 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
384 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
384 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
385 |
|
385 | |||
386 | applied patches after stripping rev in queue |
|
386 | applied patches after stripping rev in queue | |
387 |
|
387 | |||
388 | $ hg qapplied |
|
388 | $ hg qapplied | |
389 | 2.diff |
|
389 | 2.diff | |
390 |
|
390 | |||
391 | stripping ancestor of queue |
|
391 | stripping ancestor of queue | |
392 |
|
392 | |||
393 | $ hg strip 1 |
|
393 | $ hg strip 1 | |
394 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
394 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
395 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
395 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
396 |
|
396 | |||
397 | applied patches after stripping ancestor of queue |
|
397 | applied patches after stripping ancestor of queue | |
398 |
|
398 | |||
399 | $ hg qapplied |
|
399 | $ hg qapplied | |
400 |
|
400 | |||
401 | Verify strip protects against stripping wc parent when there are uncommitted mods |
|
401 | Verify strip protects against stripping wc parent when there are uncommitted mods | |
402 |
|
402 | |||
403 | $ echo b > b |
|
403 | $ echo b > b | |
404 | $ hg add b |
|
404 | $ hg add b | |
405 | $ hg ci -m 'b' |
|
405 | $ hg ci -m 'b' | |
406 | $ hg log --graph |
|
406 | $ hg log --graph | |
407 | @ changeset: 1:7519abd79d14 |
|
407 | @ changeset: 1:7519abd79d14 | |
408 | | tag: tip |
|
408 | | tag: tip | |
409 | | user: test |
|
409 | | user: test | |
410 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
410 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
411 | | summary: b |
|
411 | | summary: b | |
412 | | |
|
412 | | | |
413 | o changeset: 0:9ab35a2d17cb |
|
413 | o changeset: 0:9ab35a2d17cb | |
414 | user: test |
|
414 | user: test | |
415 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
415 | date: Thu Jan 01 00:00:00 1970 +0000 | |
416 | summary: a |
|
416 | summary: a | |
417 |
|
417 | |||
418 |
|
418 | |||
419 | $ echo c > b |
|
419 | $ echo c > b | |
420 | $ echo c > bar |
|
420 | $ echo c > bar | |
421 | $ hg strip tip |
|
421 | $ hg strip tip | |
422 | abort: local changes found |
|
422 | abort: local changes found | |
423 | [255] |
|
423 | [255] | |
424 | $ hg strip tip --keep |
|
424 | $ hg strip tip --keep | |
425 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
425 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
426 | $ hg log --graph |
|
426 | $ hg log --graph | |
427 | @ changeset: 0:9ab35a2d17cb |
|
427 | @ changeset: 0:9ab35a2d17cb | |
428 | tag: tip |
|
428 | tag: tip | |
429 | user: test |
|
429 | user: test | |
430 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
430 | date: Thu Jan 01 00:00:00 1970 +0000 | |
431 | summary: a |
|
431 | summary: a | |
432 |
|
432 | |||
433 | $ hg status |
|
433 | $ hg status | |
434 | M bar |
|
434 | M bar | |
435 | ? b |
|
435 | ? b | |
436 |
|
436 | |||
437 | Strip adds, removes, modifies with --keep |
|
437 | Strip adds, removes, modifies with --keep | |
438 |
|
438 | |||
439 | $ touch b |
|
439 | $ touch b | |
440 | $ hg add b |
|
440 | $ hg add b | |
441 | $ hg commit -mb |
|
441 | $ hg commit -mb | |
442 | $ touch c |
|
442 | $ touch c | |
443 |
|
443 | |||
444 | ... with a clean working dir |
|
444 | ... with a clean working dir | |
445 |
|
445 | |||
446 | $ hg add c |
|
446 | $ hg add c | |
447 | $ hg rm bar |
|
447 | $ hg rm bar | |
448 | $ hg commit -mc |
|
448 | $ hg commit -mc | |
449 | $ hg status |
|
449 | $ hg status | |
450 | $ hg strip --keep tip |
|
450 | $ hg strip --keep tip | |
451 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
451 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
452 | $ hg status |
|
452 | $ hg status | |
453 | ! bar |
|
453 | ! bar | |
454 | ? c |
|
454 | ? c | |
455 |
|
455 | |||
456 | ... with a dirty working dir |
|
456 | ... with a dirty working dir | |
457 |
|
457 | |||
458 | $ hg add c |
|
458 | $ hg add c | |
459 | $ hg rm bar |
|
459 | $ hg rm bar | |
460 | $ hg commit -mc |
|
460 | $ hg commit -mc | |
461 | $ hg status |
|
461 | $ hg status | |
462 | $ echo b > b |
|
462 | $ echo b > b | |
463 | $ echo d > d |
|
463 | $ echo d > d | |
464 | $ hg strip --keep tip |
|
464 | $ hg strip --keep tip | |
465 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
465 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) | |
466 | $ hg status |
|
466 | $ hg status | |
467 | M b |
|
467 | M b | |
468 | ! bar |
|
468 | ! bar | |
469 | ? c |
|
469 | ? c | |
470 | ? d |
|
470 | ? d | |
471 | $ cd .. |
|
471 | $ cd .. | |
472 |
|
472 | |||
473 | stripping many nodes on a complex graph (issue3299) |
|
473 | stripping many nodes on a complex graph (issue3299) | |
474 |
|
474 | |||
475 | $ hg init issue3299 |
|
475 | $ hg init issue3299 | |
476 | $ cd issue3299 |
|
476 | $ cd issue3299 | |
477 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' |
|
477 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' | |
478 | $ hg strip 'not ancestors(x)' |
|
478 | $ hg strip 'not ancestors(x)' | |
479 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) |
|
479 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) | |
480 |
|
480 | |||
481 | test hg strip -B bookmark |
|
481 | test hg strip -B bookmark | |
482 |
|
482 | |||
483 | $ cd .. |
|
483 | $ cd .. | |
484 | $ hg init bookmarks |
|
484 | $ hg init bookmarks | |
485 | $ cd bookmarks |
|
485 | $ cd bookmarks | |
486 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b' |
|
486 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b' | |
487 | $ hg bookmark -r 'a' 'todelete' |
|
487 | $ hg bookmark -r 'a' 'todelete' | |
488 | $ hg bookmark -r 'b' 'B' |
|
488 | $ hg bookmark -r 'b' 'B' | |
489 | $ hg bookmark -r 'b' 'nostrip' |
|
489 | $ hg bookmark -r 'b' 'nostrip' | |
490 | $ hg bookmark -r 'c' 'delete' |
|
490 | $ hg bookmark -r 'c' 'delete' | |
491 | $ hg up -C todelete |
|
491 | $ hg up -C todelete | |
492 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
492 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
493 | (activating bookmark todelete) |
|
493 | (activating bookmark todelete) | |
494 | $ hg strip -B nostrip |
|
494 | $ hg strip -B nostrip | |
495 | bookmark 'nostrip' deleted |
|
495 | bookmark 'nostrip' deleted | |
496 | abort: empty revision set |
|
496 | abort: empty revision set | |
497 | [255] |
|
497 | [255] | |
498 | $ hg strip -B todelete |
|
498 | $ hg strip -B todelete | |
499 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
499 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
500 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
500 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) | |
501 | bookmark 'todelete' deleted |
|
501 | bookmark 'todelete' deleted | |
502 | $ hg id -ir dcbb326fdec2 |
|
502 | $ hg id -ir dcbb326fdec2 | |
503 | abort: unknown revision 'dcbb326fdec2'! |
|
503 | abort: unknown revision 'dcbb326fdec2'! | |
504 | [255] |
|
504 | [255] | |
505 | $ hg id -ir d62d843c9a01 |
|
505 | $ hg id -ir d62d843c9a01 | |
506 | d62d843c9a01 |
|
506 | d62d843c9a01 | |
507 | $ hg bookmarks |
|
507 | $ hg bookmarks | |
508 | B 9:ff43616e5d0f |
|
508 | B 9:ff43616e5d0f | |
509 | delete 6:2702dd0c91e7 |
|
509 | delete 6:2702dd0c91e7 | |
510 | $ hg strip -B delete |
|
510 | $ hg strip -B delete | |
511 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
511 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) | |
512 | bookmark 'delete' deleted |
|
512 | bookmark 'delete' deleted | |
513 | $ hg id -ir 6:2702dd0c91e7 |
|
513 | $ hg id -ir 6:2702dd0c91e7 | |
514 | abort: unknown revision '2702dd0c91e7'! |
|
514 | abort: unknown revision '2702dd0c91e7'! | |
515 | [255] |
|
515 | [255] | |
516 | $ hg update B |
|
516 | $ hg update B | |
517 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
517 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
518 | (activating bookmark B) |
|
518 | (activating bookmark B) | |
519 | $ echo a > a |
|
519 | $ echo a > a | |
520 | $ hg add a |
|
520 | $ hg add a | |
521 | $ hg strip -B B |
|
521 | $ hg strip -B B | |
522 | abort: local changes found |
|
522 | abort: local changes found | |
523 | [255] |
|
523 | [255] | |
524 | $ hg bookmarks |
|
524 | $ hg bookmarks | |
525 | * B 6:ff43616e5d0f |
|
525 | * B 6:ff43616e5d0f | |
526 |
|
526 | |||
527 | $ cd .. |
|
527 | Make sure no one adds back a -b option: | |
|
528 | ||||
|
529 | $ hg strip -b tip | |||
|
530 | hg strip: option -b not recognized | |||
|
531 | hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV... | |||
|
532 | ||||
|
533 | strip changesets and all their descendants from the repository | |||
|
534 | ||||
|
535 | use "hg help -e strip" to show help for the strip extension | |||
|
536 | ||||
|
537 | options: | |||
|
538 | ||||
|
539 | -r --rev REV [+] strip specified revision (optional, can specify revisions | |||
|
540 | without this option) | |||
|
541 | -f --force force removal of changesets, discard uncommitted changes | |||
|
542 | (no backup) | |||
|
543 | --no-backup no backups | |||
|
544 | -k --keep do not modify working copy during strip | |||
|
545 | -B --bookmark VALUE remove revs only reachable from given bookmark | |||
|
546 | --mq operate on patch repository | |||
|
547 | ||||
|
548 | [+] marked option can be specified multiple times | |||
|
549 | ||||
|
550 | use "hg help strip" to show the full help text | |||
|
551 | [255] |
General Comments 0
You need to be logged in to leave comments.
Login now