From 2ae3ea32b982d9855c4943cc6c54adbb9d227aea Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Tue, 13 May 2008 22:33:58 +0000 Subject: Add subversion support for repoman (patch by Fabien Groffen, http://archives.gentoo.org/gentoo-portage-dev/msg_b7080f212c3eb09c943a1ce5a7356f01.xml) svn path=/main/trunk/; revision=10325 --- pym/repoman/utilities.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'pym/repoman') diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index 7666ba5d6..28df593cf 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -42,30 +42,39 @@ def detect_vcs_conflicts(options, vcs): retval = commands.getstatusoutput("cvs -n up 2>&1 | " + \ "egrep '^[^\?] .*' | " + \ "egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'") + if vcs == 'svn': + logging.info("Performing a " + output.green("svn status -u") + \ + " with a little magic grep to check for updates.") + retval = commands.getstatusoutput("svn status -u 2>&1 | " + \ + "egrep -v '^. +.*/digest-[^/]+' | " + \ + "head -n-1") + if vcs in ['cvs', 'svn']: mylines = retval[1].splitlines() myupdates = [] for line in mylines: if not line: continue - if line[0] not in "UPMAR": # Updates,Patches,Modified,Added,Removed + if line[0] not in "UPMARD": # Updates,Patches,Modified,Added,Removed/Replaced(svn),Deleted(svn) logging.error(red("!!! Please fix the following issues reported " + \ - "from cvs: ")+green("(U,P,M,A,R are ok)")) + "from cvs: ")+green("(U,P,M,A,R,D are ok)")) logging.error(red("!!! Note: This is a pretend/no-modify pass...")) logging.error(retval[1]) sys.exit(1) - elif line[0] in "UP": + elif vcs == 'cvs' and line[0] in "UP": myupdates.append(line[2:]) + elif vcs == 'svn' and line[8] == '*': + myupdates.append(line[9:].lstrip(" 1234567890")) if myupdates: logging.info(green("Fetching trivial updates...")) if options.pretend: - logging.info("(cvs up "+" ".join(myupdates)+")") + logging.info("(" + vcs + " update " + " ".join(myupdates) + ")") retval = os.EX_OK else: - retval = os.system("cvs up " + " ".join(myupdates)) + retval = os.system(vcs + " update " + " ".join(myupdates)) if retval != os.EX_OK: - logging.fatal("!!! cvs exited with an error. Terminating.") + logging.fatal("!!! " + cvs + " exited with an error. Terminating.") sys.exit(retval) -- cgit v1.2.3-1-g7c22