summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2010-02-13 18:55:34 -0800
committerChristian Hammond <chipx86@chipx86.com>2010-02-13 18:55:34 -0800
commitddfec219fd582419b914b77c6652ff03e7a2b8ca (patch)
treea7e863256e07bfd657d0bf97801f561498fdade6
parentf16aed06ad9c2a90c2e4058351357ecce4188f0f (diff)
Filter out usernames from Mercurial repository paths in .hgrc
We filtered out the username from a path when running 'hg svn info', but not when reading from .hgrc. We now apply the same filtering logic. This allows post-review to match a repository path with a username in it against a repository path on a Review Board server. Patch by Tom Saeger. Reviewed at http://reviews.reviewboard.org/r/1390/
-rw-r--r--AUTHORS1
-rwxr-xr-xrbtools/postreview.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index f90ad89..76f5db2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -26,3 +26,4 @@ Contributors:
* Stacey Sheldon
* Stefan Ring
* Steven Russell
+ * Tom Saeger
diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index e8ea416..207f8be 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -1924,6 +1924,10 @@ class MercurialClient(SCMClient):
supports_parent_diffs=True)
path = m.group(1).strip()
+ m2 = re.match(r'^(svn\+ssh|http|https)://([-a-zA-Z0-9.]*@)(.*)$',
+ path)
+ if m2:
+ path = '%s://%s' % (m2.group(1), m2.group(3))
return RepositoryInfo(path=path, base_path='',
supports_parent_diffs=True)