[cig-commits] commit: Make --walkhg=true be the default behaviour.

Mercurial hg at geodynamics.org
Mon Nov 24 11:27:08 PST 2008


changeset:   59:00777c6a37b6
user:        Simon Law <simon at akoha.org>
date:        Tue Aug 28 15:26:17 2007 -0400
files:       forest.py test-forest test-forest.out
description:
Make --walkhg=true be the default behaviour.


diff -r d575d52a113b -r 00777c6a37b6 forest.py
--- a/forest.py	Mon Aug 27 13:30:08 2007 -0400
+++ b/forest.py	Tue Aug 28 15:26:17 2007 -0400
@@ -83,8 +83,8 @@ def cmd_options(ui, cmd, remove=None):
     return res
 
 def walkhgenabled(ui, walkhg):
-    if walkhg == '':
-        walkhg = ui.config('forest', 'walkhg', 'false')
+    if not walkhg:
+        walkhg = ui.config('forest', 'walkhg', 'true')
     try:
         res = { '0' : False, 'false' : False, 'no' : False,
                 '1' : True, 'true' : True, 'yes' : True }[walkhg.lower()]
@@ -655,13 +655,12 @@ def update(ui, toprepo, snapfile=None, t
 
 def uisetup(ui):
     global cmdtable
-    walkhgopt = ('', 'walkhg', '',
-                 _("whether to walk (1|yes|true) repositories under '.hg' or "
-                   "not (0|no|false)"))
+    walkhgopts = ('', 'walkhg', '',
+                 _("walk repositories under '.hg' (yes/no)"))
     cmdtable = {
         "fclone" :
             (clone,
-             [walkhgopt] + cmd_options(ui, 'clone', remove=('r',)),
+             [walkhgopts] + cmd_options(ui, 'clone', remove=('r',)),
              _('hg fclone [OPTIONS] SOURCE DESTINATION')),
         "fpull" :
             (pull,
@@ -683,23 +682,23 @@ def uisetup(ui):
             (snapshot,
              [('t', 'tip', False,
                _("record tip instead of actual child revisions")),
-              walkhgopt],
+              walkhgopts],
              _('hg fsnap [OPTIONS] [SNAPSHOT-FILE]')),
         "fstatus" :
             (status,
-             [walkhgopt] + cmd_options(ui, 'status'),
+             [walkhgopts] + cmd_options(ui, 'status'),
              _('hg fstatus [OPTIONS]')),
         "ftrees" :
             (trees,
              [('c', 'convert', False,
                _("convert paths to mercurial representation")),
-              walkhgopt],
+              walkhgopts],
              _('hg ftrees [OPTIONS]')),
         "fupdate" :
             (update,
              [('', 'tip', False,
                _("update working directories to a specified revision")),
-              walkhgopt]
+              walkhgopts]
              + cmd_options(ui, 'update', remove=('d',)),
              _('hg fupdate [OPTIONS] (--tip | SNAPSHOT-FILE)'))
         }
diff -r d575d52a113b -r 00777c6a37b6 test-forest
--- a/test-forest	Mon Aug 27 13:30:08 2007 -0400
+++ b/test-forest	Tue Aug 28 15:26:17 2007 -0400
@@ -140,9 +140,13 @@ hg init walkhg/.hg/h
 hg init walkhg/.hg/h
 hg init walkhg/a
 hg init walkhg/a/.hg/h
-hg ftrees --cwd walkhg --convert
-hg ftrees -R walkhg --convert --walkhg=1
+hg ftrees --cwd walkhg --convert --walkhg=0
+hg ftrees -R walkhg --convert
 echo "[forest]" >> walkhg/.hg/hgrc
 echo "walkhg = Yes" >> walkhg/.hg/hgrc
 hg ftrees -R walkhg --convert
 hg ftrees --cwd walkhg --convert --walkhg=FALSE
+echo "[forest]" >> walkhg/.hg/hgrc
+echo "walkhg = No" >> walkhg/.hg/hgrc
+hg ftrees -R walkhg --convert
+hg ftrees --cwd walkhg --convert --walkhg=FALSE
diff -r d575d52a113b -r 00777c6a37b6 test-forest.out
--- a/test-forest.out	Mon Aug 27 13:30:08 2007 -0400
+++ b/test-forest.out	Tue Aug 28 15:26:17 2007 -0400
@@ -404,3 +404,7 @@ a/.hg/h
 a/.hg/h
 .
 a
+.
+a
+.
+a



More information about the CIG-COMMITS mailing list