aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys
diff options
context:
space:
mode:
Diffstat (limited to 'RepSys')
-rw-r--r--RepSys/commands/submit.py14
-rw-r--r--RepSys/rpmutil.py25
2 files changed, 16 insertions, 23 deletions
diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py
index 5c95526..25d5831 100644
--- a/RepSys/commands/submit.py
+++ b/RepSys/commands/submit.py
@@ -20,6 +20,9 @@ Usage: repsys submit [OPTIONS] [URL [REVISION]]
Submits the package from URL to the submit host.
+If no URL and revision are specified, the latest changed revision in
+the package working copy of the current directory will be used.
+
Options:
-t TARGET Submit given package URL to given target
-l Just list available targets
@@ -51,15 +54,8 @@ def parse_options():
opts, args = parser.parse_args()
if not args:
name, rev = get_submit_info(".")
- try:
- yn = raw_input("Submit '%s', revision %d (y/N)? " % (name, rev))
- except KeyboardInterrupt:
- yn = "n"
- if yn.lower() in ("y", "yes"):
- args = name, str(rev)
- else:
- print "Cancelled."
- sys.exit(1)
+ args = name, str(rev)
+ print "submitting %s at revision %s..." % args
elif len(args) > 2:
raise Error, "invalid arguments"
opts.pkgdirurl = default_parent(args[0])
diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py
index 69692f1..774f64f 100644
--- a/RepSys/rpmutil.py
+++ b/RepSys/rpmutil.py
@@ -490,20 +490,17 @@ def get_submit_info(path):
if not os.path.isdir(os.path.join(path, ".svn")):
raise Error, "subversion directory not found"
- svn = SVN(baseurl=pkgdirurl)
-
+ svn = SVN(noauth=True)
# Now, extract the package name.
- for line in svn.info(path):
- if line.startswith("URL: "):
- url = line.split()[1]
- toks = url.split("/")
- if len(toks) < 2 or toks[-1] != "current":
- raise Error, "unexpected URL received from 'svn info'"
- name = toks[-2]
- break
- else:
- raise Error, "URL tag not found in 'svn info' output"
+ info = svn.info2(path)
+ url = info.get("URL")
+ if url is None:
+ raise Error, "missing URL from svn info %s" % path
+ toks = url.split("/")
+ if len(toks) < 2 or toks[-1] != "current":
+ raise Error, "unexpected URL received from 'svn info'"
+ name = toks[-2]
# Finally, guess revision.
max = -1
@@ -511,8 +508,8 @@ def get_submit_info(path):
files.extend(glob.glob("%s/*" % specsdir))
files.extend(glob.glob("%s/*" % sourcesdir))
for line in svn.info(" ".join(files)):
- if line.startswith("Revision: "):
- rev = int(line.split()[1])
+ if line.startswith("Last Changed Rev: "):
+ rev = int(line.split(":")[1])
if rev > max:
max = rev
if max == -1: