comparison hgsubversion/util.py @ 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 5adfb81c4680
comparison
equal deleted inserted replaced
1520:fc91ba4ffa52 1521:f73cc01a8167
334 # parentctx is not an ancestor of childctx, files are unrelated 334 # parentctx is not an ancestor of childctx, files are unrelated
335 return False 335 return False
336 336
337 def getsvnrev(ctx, defval=None): 337 def getsvnrev(ctx, defval=None):
338 '''Extract SVN revision from commit metadata''' 338 '''Extract SVN revision from commit metadata'''
339 return ctx.extra().get('convert_revision', defval) 339 convertrev = ctx.extra().get('convert_revision', '')
340 # if the rev doesn't start with svn prefix it came from different source
341 if convertrev.startswith('svn:'):
342 return convertrev
343 return defval
340 344
341 def revset_fromsvn(repo, subset, x): 345 def revset_fromsvn(repo, subset, x):
342 '''``fromsvn()`` 346 '''``fromsvn()``
343 Select changesets that originate from Subversion. 347 Select changesets that originate from Subversion.
344 ''' 348 '''