From b35dfdf10b2f58a0632d0a0542bd8232a39b0391 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 20 Nov 2009 14:29:01 -0500 Subject: Adjusted test.py to use an installed vcs by default. Protects agaist the off chance that the user doesn't have Arch (tla) installed ;). Changed Arch.name from "Arch" to "arch" so that each VCSs .name matches the module name. This allows us to use vcs.VCS_ORDER (a list of module names) to set up the allowed values of BugDir.vcs_name. --- becommands/init.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'becommands/init.py') diff --git a/becommands/init.py b/becommands/init.py index 275dd77..75db0ac 100644 --- a/becommands/init.py +++ b/becommands/init.py @@ -37,14 +37,13 @@ def execute(args, manipulate_encodings=True): >>> dir = utility.Dir() >>> os.chdir(dir.path) - >>> vcs = vcs.installed_vcs() - >>> vcs.init('.') - >>> print vcs.name - Arch - >>> execute([], manipulate_encodings=False) - Using Arch for revision control. + >>> _vcs = vcs.installed_vcs() + >>> _vcs.init('.') + >>> _vcs.name in vcs.VCS_ORDER + >>> execute([], manipulate_encodings=False) # doctest: +ELLIPSIS + Using ... for revision control. Directory initialized. - >>> vcs.cleanup() + >>> _vcs.cleanup() >>> try: ... execute(['--root', '.'], manipulate_encodings=False) -- cgit From ec602165cca450dab09ff79f5baf90e8957535d4 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 20 Nov 2009 15:10:59 -0500 Subject: Fix typo in becommands.init's doctest --- becommands/init.py | 1 + 1 file changed, 1 insertion(+) (limited to 'becommands/init.py') diff --git a/becommands/init.py b/becommands/init.py index 75db0ac..39fb006 100644 --- a/becommands/init.py +++ b/becommands/init.py @@ -40,6 +40,7 @@ def execute(args, manipulate_encodings=True): >>> _vcs = vcs.installed_vcs() >>> _vcs.init('.') >>> _vcs.name in vcs.VCS_ORDER + True >>> execute([], manipulate_encodings=False) # doctest: +ELLIPSIS Using ... for revision control. Directory initialized. -- cgit From 614d4e40e148520ac511cbe0606bcbdcf24c8a08 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Nov 2009 15:18:02 -0500 Subject: Added restrict_file_access to becommands' execute() args. + associated adjustments in other files. See cmdutil.restrict_file_access.__doc__ for an explanation of the security hole this closes. --- becommands/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'becommands/init.py') diff --git a/becommands/init.py b/becommands/init.py index 39fb006..7d6d475 100644 --- a/becommands/init.py +++ b/becommands/init.py @@ -20,7 +20,7 @@ import os.path from libbe import cmdutil, bugdir __desc__ = __doc__ -def execute(args, manipulate_encodings=True): +def execute(args, manipulate_encodings=True, restrict_file_access=False): """ >>> from libbe import utility, vcs >>> import os -- cgit