From f6f05822b727d42b85ea03b23d4e2d4240b24215 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 7 Apr 2023 00:13:03 -0700 Subject: Support -r in the up command (mga#3913) --- MgaRepo/commands/up.py | 2 ++ MgaRepo/rpmutil.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'MgaRepo') diff --git a/MgaRepo/commands/up.py b/MgaRepo/commands/up.py index 646a79f..18635f9 100644 --- a/MgaRepo/commands/up.py +++ b/MgaRepo/commands/up.py @@ -8,11 +8,13 @@ Usage: mgarepo up [PATH] Update the package working copy and synchronize all binaries. Options: + -r REV Revision to update to -h help """ def parse_options(): parser = OptionParser(help=HELP) + parser.add_option("-r", dest="revision") opts, args = parser.parse_args() if args: opts.target = args[0] diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py index 769167c..9673111 100644 --- a/MgaRepo/rpmutil.py +++ b/MgaRepo/rpmutil.py @@ -632,7 +632,7 @@ def spec_sources(topdir): sources = [name for name, x, y in spec.sources()] return sources -def update(target=None): +def update(target=None, revision=None): svn = SVN() info = None svn_target = None @@ -644,7 +644,7 @@ def update(target=None): svn_target = top br_target = top if svn_target: - svn.update(svn_target, show=True) + svn.update(svn_target, rev=revision, show=True) if br_target: info = svn.info2(svn_target) if not br_target and not svn_target: -- cgit v1.2.1