D4908: extensions: fix close-head -r listification

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Mon Oct 8 18:31:18 UTC 2018


joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4908

AFFECTED FILES
  hgext/closehead.py
  tests/test-close-head.t

CHANGE DETAILS

diff --git a/tests/test-close-head.t b/tests/test-close-head.t
--- a/tests/test-close-head.t
+++ b/tests/test-close-head.t
@@ -1,8 +1,22 @@
   $ hg init test-content
   $ cd test-content
-  $ hg debugbuilddag '+2*2*3*4'
+  $ hg debugbuilddag '+2*2*3*4+7'
   $ hg bookmark -r 1 @
   $ 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  3:6100d3090acf
@@ -23,19 +37,18 @@
   $ hg bookmark
      @                         1:66f7d451a68b
   $ hg heads
-  changeset:   4:e7bd5218ca15
-  parent:      0:1ea73414a91b
+  changeset:   11:1d876b1f862c
   user:        debugbuilddag
-  date:        Thu Jan 01 00:00:04 1970 +0000
-  summary:     r4
+  date:        Thu Jan 01 00:00:11 1970 +0000
+  summary:     r11
   
   changeset:   3:6100d3090acf
   parent:      0:1ea73414a91b
   user:        debugbuilddag
   date:        Thu Jan 01 00:00:03 1970 +0000
   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
   changeset:   3:6100d3090acf
   parent:      0:1ea73414a91b
diff --git a/hgext/closehead.py b/hgext/closehead.py
--- a/hgext/closehead.py
+++ b/hgext/closehead.py
@@ -28,7 +28,7 @@
 
 commitopts = cmdutil.commitopts
 commitopts2 = cmdutil.commitopts2
-commitopts3 = [('r', 'rev', '',
+commitopts3 = [('r', 'rev', [],
                _('revision to check'), _('REV'))]
 
 @command('close-head|close-heads', commitopts + commitopts2 + commitopts3,



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list