diff options
author | Andreas Hasenack <andreas@mandriva.com> | 2006-02-02 18:37:42 +0000 |
---|---|---|
committer | Andreas Hasenack <andreas@mandriva.com> | 2006-02-02 18:37:42 +0000 |
commit | 8d41f3bf00a47e930b3dc92d5b28a8a3a5126c77 (patch) | |
tree | a3ffa4b776337f2f99531c75553803356a31e0d7 /RepSys/svn.py | |
parent | 6bf0978af43f267fc17ce6e5d64e2053e60dae5f (diff) | |
download | mgarepo-8d41f3bf00a47e930b3dc92d5b28a8a3a5126c77.tar mgarepo-8d41f3bf00a47e930b3dc92d5b28a8a3a5126c77.tar.gz mgarepo-8d41f3bf00a47e930b3dc92d5b28a8a3a5126c77.tar.bz2 mgarepo-8d41f3bf00a47e930b3dc92d5b28a8a3a5126c77.tar.xz mgarepo-8d41f3bf00a47e930b3dc92d5b28a8a3a5126c77.zip |
- on behalf of bogdano@mandriva.com:
- improved markrelease command line parsing
- changelogs entries are now groupped by author, and sorted by revision
number
- the changelog now is generated using the Cheetah Template Engine, to
allow quick modifications without spending time reading code and
introducing new bugs
- consequently, was added an option "-T <file>" to rpmlog and getsrpm to
allow choosing the path of the template to be used
- added options noauth=0, and baseurl=None in order to disable the
authentication in some url schemes (http:// and //)
- replaced some "cl" references to "mdv"
Diffstat (limited to 'RepSys/svn.py')
-rw-r--r-- | RepSys/svn.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/RepSys/svn.py b/RepSys/svn.py index 6a42e6d..4804a39 100644 --- a/RepSys/svn.py +++ b/RepSys/svn.py @@ -1,5 +1,5 @@ from RepSys import Error, config, pexpect -from RepSys.util import execcmd +from RepSys.util import execcmd, get_auth import sys import re import time @@ -17,18 +17,18 @@ class SVNLogEntry: return cmp(self.date, other.date) class SVN: - def __init__(self, username=None, password=None): - if not username: - username = config.get("auth", "username") - if not password: - password = config.get("auth", "password") + def __init__(self, username=None, password=None, noauth=0, baseurl=None): + self.noauth = noauth or ( + baseurl and ( + baseurl.startswith("file:") or + baseurl.startswith("svn+ssh:"))) + if not self.noauth: # argh + self.username, self.password = get_auth() - self.username = username - self.password = password def _execsvn(self, *args, **kwargs): cmdstr = "svn "+" ".join(args) - if kwargs.get("local"): + if kwargs.get("local") or kwargs.get("noauth") or self.noauth: return execcmd(cmdstr, **kwargs) show = kwargs.get("show") noerror = kwargs.get("noerror") @@ -132,6 +132,11 @@ class SVN: self._add_log(cmd, kwargs) return self._execsvn_success(*cmd, **kwargs) + def export(self, url, targetpath, **kwargs): + cmd = ["export", "'%s'" % url, targetpath] + self._add_revision(cmd, kwargs, optional=1) + return self._execsvn_success(*cmd, **kwargs) + def checkout(self, url, targetpath, **kwargs): cmd = ["checkout", "'%s'" % url, targetpath] self._add_revision(cmd, kwargs, optional=1) @@ -260,7 +265,7 @@ class SVN: if status != 0: return None - revheader = re.compile("^r(?P<revision>[0-9]+) \| (?P<author>.+?) \| (?P<date>.+?) \| (?P<lines>[0-9]+) (?:line|lines)") + revheader = re.compile("^r(?P<revision>[0-9]+) \| (?P<author>[^\|]+) \| (?P<date>[^\|]+) \| (?P<lines>[0-9]+) (?:line|lines)$") logseparator = "-"*72 linesleft = 0 entry = None |