[users at bb.net] Background on split_file_branches
pmatos at linki.tools
Wed Sep 13 13:12:18 UTC 2017
I am noticing a strange behaviour when using util.svn.split_file_branches.
It the branch is trunk, then it is set to None, i.e. if the function
receives 'trunk/foo.txt' it returns (None, 'foo.txt')
This is strange since, you use as suggested by the documentation:
this will checkout for trunk svn://domain//, and not svn://domain/trunk.
However it will work well for svn://domain/branches/1_4_1, etc.
This behaviour is rather confusing given the documentation where
src::branch is mentioned, which says you can use it as above.
On the other hand, I can define my own split file as:
pieces = path.split('/')
if len(pieces) > 1 and pieces == 'trunk':
return (pieces, '/'.join(pieces[1:]))
elif len(pieces) > 2 and pieces == 'branches':
return ('/'.join(pieces[0:2]), '/'.join(pieces[2:]))
And this will work... when I call the function I get as expected 'trunk'
as the first element of the tuple when relative path belongs to trunk.
However, when I use it in my class which inherits from, I cannot seem to
have access to these properties:
class CloneOrUpdateRepo (SVN):
name = "update repo"
description = r"fetching sources"
descriptionDone = r"fetched sources"
def __init__ (self):
mode = 'incremental')
self.haltOnFailure = True
I expected these (src::branch) and (prop:builddir) to be stored globally
and that Interpolate would be able to access them everywhere but I seem
to be mistaken given that the above doesn't work.
What do I need so that my class gets access to the properties?
More information about the users