##// END OF EJS Templates
commit: allow closing "non-head" changesets...
Mads Kiilerich -
r18955:f3245f22 default
parent child Browse files
Show More
@@ -1299,10 +1299,6 b' def commit(ui, repo, *pats, **opts):'
1299
1299
1300 extra = {}
1300 extra = {}
1301 if opts.get('close_branch'):
1301 if opts.get('close_branch'):
1302 if repo['.'].node() not in repo.branchheads():
1303 # The topo heads set is included in the branch heads set of the
1304 # current branch, so it's sufficient to test branchheads
1305 raise util.Abort(_('can only close branch heads'))
1306 extra['close'] = 1
1302 extra['close'] = 1
1307
1303
1308 branch = repo[None].branch()
1304 branch = repo[None].branch()
@@ -256,6 +256,27 b' verify update will accept invalid legacy'
256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
257 $ hg commit -d '9 0' --close-branch -m 'close this part branch too'
258
258
259 $ hg commit -d '9 0' --close-branch -m 're-closing this branch'
260 $ hg log -r tip --debug
261 changeset: 13:c2601d54b1427e99506bee25a566ef3a5963af0b
262 branch: b
263 tag: tip
264 phase: draft
265 parent: 12:e3d49c0575d8fc2cb1cd6859c747c14f5f6d499f
266 parent: -1:0000000000000000000000000000000000000000
267 manifest: 8:6f9ed32d2b310e391a4f107d5f0f071df785bfee
268 user: test
269 date: Thu Jan 01 00:00:09 1970 +0000
270 extra: branch=b
271 extra: close=1
272 description:
273 re-closing this branch
274
275
276 $ hg rollback
277 repository tip rolled back to revision 12 (undo commit)
278 working directory now based on revision 12
279
259 --- b branch should be inactive
280 --- b branch should be inactive
260
281
261 $ hg branches
282 $ hg branches
@@ -78,9 +78,6 b''
78 $ hg branch all
78 $ hg branch all
79 marked working directory as branch all
79 marked working directory as branch all
80 (branches are permanent and global, did you want a bookmark?)
80 (branches are permanent and global, did you want a bookmark?)
81 $ hg ci --close-branch -Aqm8
82 abort: can only close branch heads
83 [255]
84
81
85 $ hg co 4
82 $ hg co 4
86 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now