changeset 59:00777c6a37b6

Make --walkhg=true be the default behaviour.
author Simon Law <simon@akoha.org>
date Tue, 28 Aug 2007 15:26:17 -0400
parents d575d52a113b
children df4e33bd7149
files forest.py test-forest test-forest.out
diffstat 3 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
     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 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 @@
             (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)'))
         }
--- 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/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
--- 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
+.
+a
+.
+a