aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys/commands/log.py
diff options
context:
space:
mode:
authorMageia SVN-Git Migration <svn-git-migration@mageia.org>2011-01-04 16:09:44 +0000
committerMageia SVN-Git Migration <svn-git-migration@mageia.org>2011-01-04 16:09:44 +0000
commit846c9e0ef180aa5411803eb1906896dc5e2fc5b9 (patch)
treef82d50447e2f648e76d051cb20ca4c44b1dde8a8 /RepSys/commands/log.py
parent085ad0c1554260fe8f87955ed1ba74e06413f416 (diff)
downloadmgarepo-846c9e0ef180aa5411803eb1906896dc5e2fc5b9.tar
mgarepo-846c9e0ef180aa5411803eb1906896dc5e2fc5b9.tar.gz
mgarepo-846c9e0ef180aa5411803eb1906896dc5e2fc5b9.tar.bz2
mgarepo-846c9e0ef180aa5411803eb1906896dc5e2fc5b9.tar.xz
mgarepo-846c9e0ef180aa5411803eb1906896dc5e2fc5b9.zip
Synthesized commit during git-svn import combining previous Mandriva history with Magiea.
This commit consitsts of the following subversion commits: ------------------------------------------------------------------------ r202 | boklm | 2011-01-04 16:09:44 +0000 (Tue, 04 Jan 2011) | 1 line add repsys ------------------------------------------------------------------------
Diffstat (limited to 'RepSys/commands/log.py')
-rwxr-xr-xRepSys/commands/log.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/RepSys/commands/log.py b/RepSys/commands/log.py
new file mode 100755
index 0000000..28df27d
--- /dev/null
+++ b/RepSys/commands/log.py
@@ -0,0 +1,62 @@
+#!/usr/bin/python
+from RepSys import config, mirror, disable_mirror
+from RepSys.command import *
+from RepSys.layout import package_url, checkout_url
+from RepSys.rpmutil import sync
+from RepSys.util import execcmd
+import sys
+import os
+
+HELP = """\
+Usage: repsys log [OPTIONS] [PACKAGE]
+
+Shows the SVN log for a given package.
+
+Options:
+ -h Show this message
+ -v Show changed paths
+ -l LIMIT Limit of log entries to show
+ -r REV Show a specific revision
+ -M Do not use the mirror (use the main repository)
+
+Examples:
+ repsys log mutt
+ repsys log 2009.1/mutt
+"""
+
+def parse_options():
+ parser = OptionParser(help=HELP)
+ parser.add_option("-v", dest="verbose", action="store_true",
+ default=False)
+ parser.add_option("-l", "--limit", dest="limit", type="int",
+ default=None)
+ parser.add_option("-r", dest="revision", type="string", default=None)
+ parser.add_option("-M", "--no-mirror", action="callback",
+ callback=disable_mirror)
+ opts, args = parser.parse_args()
+ if len(args):
+ opts.pkgdirurl = package_url(args[0])
+ else:
+ parser.error("log requires a package name")
+ return opts
+
+def svn_log(pkgdirurl, verbose=False, limit=None, revision=None):
+ mirror.info(pkgdirurl)
+ url = checkout_url(pkgdirurl)
+ svncmd = config.get("global", "svn-command", "svn")
+ args = [svncmd, "log", url]
+ if verbose:
+ args.append("-v")
+ if limit:
+ args.append("-l")
+ args.append(limit)
+ if revision:
+ args.append("-r")
+ args.append(revision)
+ if os.isatty(sys.stdin.fileno()):
+ args.append("| less")
+ rawcmd = " ".join(args)
+ execcmd(rawcmd, show=True)
+
+def main():
+ do_command(parse_options, svn_log)