diff options
author | Christian Hammond <chipx86@chipx86.com> | 2009-09-10 01:26:22 -0700 |
---|---|---|
committer | Christian Hammond <chipx86@chipx86.com> | 2009-09-10 01:26:22 -0700 |
commit | 5b042cfd560a791ecf483056d55360f103e27257 (patch) | |
tree | 44ba66bd09fd5e1765dd1ffa35511422be093ca2 | |
parent | b0b1bf197def8f44eea43cdb6f900f3cb15a08c6 (diff) |
Add Repository UUID support to git-svn.
This change introduces Repository UUID support to git-svn, allowing
Review Board to match repositories by UUID instead of comparing the
repository name directly.
Patch by Matthew Woehlke.
Reviewed at http://reviews.review-board.org/r/1030/
-rw-r--r-- | AUTHORS | 1 | ||||
-rwxr-xr-x | rbtools/postreview.py | 17 |
2 files changed, 13 insertions, 5 deletions
@@ -12,6 +12,7 @@ Contributors: * Jeremy Bettis * Lepton Wu * Luke Lu + * Matthew Woehlke * Paul Scott * Raghu Kaippully * Stacey Sheldon diff --git a/rbtools/postreview.py b/rbtools/postreview.py index a87569d..2e2518f 100755 --- a/rbtools/postreview.py +++ b/rbtools/postreview.py @@ -153,8 +153,9 @@ class SvnRepositoryInfo(RepositoryInfo): A representation of a SVN source code repository. This version knows how to find a matching repository on the server even if the URLs differ. """ - def __init__(self, path, base_path, uuid): - RepositoryInfo.__init__(self, path, base_path) + def __init__(self, path, base_path, uuid, supports_parent_diffs=False): + RepositoryInfo.__init__(self, path, base_path, + supports_parent_diffs=supports_parent_diffs) self.uuid = uuid def find_server_repository_info(self, server): @@ -1864,9 +1865,15 @@ class GitClient(SCMClient): if m: base_path = m.group(1)[len(path):] or "/" - self.type = "svn" - return RepositoryInfo(path=path, base_path=base_path, - supports_parent_diffs=True) + m = re.search(r'^Repository UUID: (.+)$', data, re.M) + + if m: + uuid = m.group(1) + self.type = "svn" + + return SvnRepositoryInfo(path=path, base_path=base_path, + uuid=uuid, + supports_parent_diffs=True) else: # Versions of git-svn before 1.5.4 don't (appear to) support # 'git svn info'. If we fail because of an older git install, |