changeset 1521:f73cc01a8167

util: don't assume that converted rev is an svn rev Summary: In repos where converted revisions come from different sources it's not nice of hgsubversion to assume that all converted rev are coming from SVN. Test Plan: Ran all current tests, nothing is broken. Not sure how to test new behaviour withour much overhead. I suppose I could write something that overrides commit extras
author Mateusz Kwapich <mitrandir@fb.com>
date Tue, 24 Oct 2017 07:36:35 -0700
parents fc91ba4ffa52
children 1122a90e329a
files hgsubversion/util.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -336,7 +336,11 @@ def issamefile(parentctx, childctx, f):
 
 def getsvnrev(ctx, defval=None):
     '''Extract SVN revision from commit metadata'''
-    return ctx.extra().get('convert_revision', defval)
+    convertrev = ctx.extra().get('convert_revision', '')
+    # if the rev doesn't start with svn prefix it came from different source
+    if convertrev.startswith('svn:'):
+        return convertrev
+    return defval
 
 def revset_fromsvn(repo, subset, x):
     '''``fromsvn()``