Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG12a72729678e: closehead: fix close-head -r listification
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
| hg-reviewers |
| Lint Skipped |
| Unit Tests Skipped |
| Path | Packages | |||
|---|---|---|---|---|
| M | hgext/closehead.py (2 lines) | |||
| M | tests/test-close-head.t (25 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| Joerg Sonnenberger | Oct 8 2018, 2:07 PM |
| # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | ||||
| # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | ||||
| # be specifying the version(s) of Mercurial they are tested with, or | # be specifying the version(s) of Mercurial they are tested with, or | ||||
| # leave the attribute unspecified. | # leave the attribute unspecified. | ||||
| testedwith = 'ships-with-hg-core' | testedwith = 'ships-with-hg-core' | ||||
| commitopts = cmdutil.commitopts | commitopts = cmdutil.commitopts | ||||
| commitopts2 = cmdutil.commitopts2 | commitopts2 = cmdutil.commitopts2 | ||||
| commitopts3 = [('r', 'rev', '', | commitopts3 = [('r', 'rev', [], | ||||
| _('revision to check'), _('REV'))] | _('revision to check'), _('REV'))] | ||||
| @command('close-head|close-heads', commitopts + commitopts2 + commitopts3, | @command('close-head|close-heads', commitopts + commitopts2 + commitopts3, | ||||
| _('[OPTION]... [REV]...'), inferrepo=True) | _('[OPTION]... [REV]...'), inferrepo=True) | ||||
| def close_branch(ui, repo, *revs, **opts): | def close_branch(ui, repo, *revs, **opts): | ||||
| """close the given head revisions | """close the given head revisions | ||||
| This is equivalent to checking out each revision in a clean tree and running | This is equivalent to checking out each revision in a clean tree and running | ||||
| $ hg init test-content | $ hg init test-content | ||||
| $ cd test-content | $ cd test-content | ||||
| $ hg debugbuilddag '+2*2*3*4' | $ hg debugbuilddag '+2*2*3*4+7' | ||||
| $ hg bookmark -r 1 @ | $ hg bookmark -r 1 @ | ||||
| $ hg log -G --template '{rev}:{node|short}' | $ hg log -G --template '{rev}:{node|short}' | ||||
| o 11:1d876b1f862c | |||||
| | | |||||
| o 10:ea5f71948eb8 | |||||
| | | |||||
| o 9:f1b0356d867a | |||||
| | | |||||
| o 8:e8d1253fb0d7 | |||||
| | | |||||
| o 7:d423bbba4459 | |||||
| | | |||||
| o 6:a2f58e9c1e56 | |||||
| | | |||||
| o 5:3a367db1fabc | |||||
| | | |||||
| o 4:e7bd5218ca15 | o 4:e7bd5218ca15 | ||||
| | | | | ||||
| | o 3:6100d3090acf | | o 3:6100d3090acf | ||||
| |/ | |/ | ||||
| | o 2:fa942426a6fd | | o 2:fa942426a6fd | ||||
| |/ | |/ | ||||
| | o 1:66f7d451a68b | | o 1:66f7d451a68b | ||||
| |/ | |/ | ||||
| o 0:1ea73414a91b | o 0:1ea73414a91b | ||||
| $ hg --config extensions.closehead= close-head -m 'Not a head' 0 1 | $ hg --config extensions.closehead= close-head -m 'Not a head' 0 1 | ||||
| abort: revision is not an open head: 0 | abort: revision is not an open head: 0 | ||||
| [255] | [255] | ||||
| $ hg --config extensions.closehead= close-head -m 'Not a head' -r 0 1 | $ hg --config extensions.closehead= close-head -m 'Not a head' -r 0 1 | ||||
| abort: revision is not an open head: 0 | abort: revision is not an open head: 0 | ||||
| [255] | [255] | ||||
| $ hg --config extensions.closehead= close-head -m 'Close old heads' -r 1 2 | $ hg --config extensions.closehead= close-head -m 'Close old heads' -r 1 2 | ||||
| $ hg bookmark | $ hg bookmark | ||||
| @ 1:66f7d451a68b | @ 1:66f7d451a68b | ||||
| $ hg heads | $ hg heads | ||||
| changeset: 4:e7bd5218ca15 | changeset: 11:1d876b1f862c | ||||
| parent: 0:1ea73414a91b | |||||
| user: debugbuilddag | user: debugbuilddag | ||||
| date: Thu Jan 01 00:00:04 1970 +0000 | date: Thu Jan 01 00:00:11 1970 +0000 | ||||
| summary: r4 | summary: r11 | ||||
| changeset: 3:6100d3090acf | changeset: 3:6100d3090acf | ||||
| parent: 0:1ea73414a91b | parent: 0:1ea73414a91b | ||||
| user: debugbuilddag | user: debugbuilddag | ||||
| date: Thu Jan 01 00:00:03 1970 +0000 | date: Thu Jan 01 00:00:03 1970 +0000 | ||||
| summary: r3 | summary: r3 | ||||
| $ hg --config extensions.closehead= close-head -m 'Close more old heads' 4 | $ hg --config extensions.closehead= close-head -m 'Close more old heads' -r 11 | ||||
| $ hg heads | $ hg heads | ||||
| changeset: 3:6100d3090acf | changeset: 3:6100d3090acf | ||||
| parent: 0:1ea73414a91b | parent: 0:1ea73414a91b | ||||
| user: debugbuilddag | user: debugbuilddag | ||||
| date: Thu Jan 01 00:00:03 1970 +0000 | date: Thu Jan 01 00:00:03 1970 +0000 | ||||
| summary: r3 | summary: r3 | ||||
| $ hg --config extensions.closehead= close-head -m 'Not a head' 0 | $ hg --config extensions.closehead= close-head -m 'Not a head' 0 | ||||