From cc444f69b7afc33401ff8eaa2f6c8b14a4e9b46e Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 8 Nov 2007 17:18:34 +0000 Subject: Added option -o to 'co' to disable the use of mirror when checking out --- CHANGES | 1 + RepSys/commands/co.py | 3 +++ RepSys/rpmutil.py | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index aa579c1..91a4dc5 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ start with this token - fixed generation of unreleased commits, it was using the previous markrelease revision as reference +- added option -o to 'co' to disable the use of mirror when checking out * 1.6.18 - added the subcommand "switch" to help with mirrors support diff --git a/RepSys/commands/co.py b/RepSys/commands/co.py index 693897a..cadcf56 100644 --- a/RepSys/commands/co.py +++ b/RepSys/commands/co.py @@ -10,6 +10,7 @@ Usage: repsys co [OPTIONS] URL [LOCALPATH] Options: -r REV Revision to checkout + -o Do not use the mirror (use official server) -h Show this message Examples: @@ -20,6 +21,8 @@ Examples: def parse_options(): parser = OptionParser(help=HELP) parser.add_option("-r", dest="revision") + parser.add_option("-o", dest="use_mirror", default=True, + action="store_false") opts, args = parser.parse_args() if len(args) not in (1, 2): raise Error, "invalid arguments" diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py index 70550e4..86fb890 100644 --- a/RepSys/rpmutil.py +++ b/RepSys/rpmutil.py @@ -356,7 +356,7 @@ def check_changed(pkgdirurl, all=0, show=0, verbose=0): "nocurrent": nocurrent, "nopristine": nopristine} -def checkout(pkgdirurl, path=None, revision=None): +def checkout(pkgdirurl, path=None, revision=None, use_mirror=True): o_pkgdirurl = pkgdirurl pkgdirurl = default_parent(o_pkgdirurl) current = os.path.join(pkgdirurl, "current") @@ -364,7 +364,7 @@ def checkout(pkgdirurl, path=None, revision=None): _, path = os.path.split(pkgdirurl) # if default_parent changed the URL, we can use mirrors because the # user did not provided complete package URL - if (o_pkgdirurl != pkgdirurl) and mirror.enabled(): + if (o_pkgdirurl != pkgdirurl) and use_mirror and mirror.enabled(): current = mirror.checkout_url(current) print "checking out from mirror", current svn = SVN() -- cgit v1.2.1