comparison hgsubversion/svnexternals.py @ 1556:53d170a6c3c8

svnexternals: clean up some trailing whitespace
author Augie Fackler <raf@durin42.com>
date Sat, 24 Mar 2018 16:39:58 -0400
parents cff81f35b31e
children
comparison
equal deleted inserted replaced
1555:cff81f35b31e 1556:53d170a6c3c8
124 def resolvedots(url): 124 def resolvedots(url):
125 """ 125 """
126 Fix references that include .. entries. 126 Fix references that include .. entries.
127 Scans a URL for .. type entries and resolves them but will not allow any 127 Scans a URL for .. type entries and resolves them but will not allow any
128 number of ..s to take us out of domain so http://.. will raise an exception. 128 number of ..s to take us out of domain so http://.. will raise an exception.
129 129
130 Tests, (Don't know how to construct a round trip for this so doctest): 130 Tests, (Don't know how to construct a round trip for this so doctest):
131 >>> # Relative URL within servers svn area 131 >>> # Relative URL within servers svn area
132 >>> resolvedots( 132 >>> resolvedots(
133 ... "http://some.svn.server/svn/some_repo/../other_repo") 133 ... "http://some.svn.server/svn/some_repo/../other_repo")
134 'http://some.svn.server/svn/other_repo' 134 'http://some.svn.server/svn/other_repo'
174 174
175 175
176 def resolvesource(ui, svnroot, source): 176 def resolvesource(ui, svnroot, source):
177 """ Resolve the source as either matching the scheme re or by resolving 177 """ Resolve the source as either matching the scheme re or by resolving
178 relative URLs which start with ^ and my include relative .. references. 178 relative URLs which start with ^ and my include relative .. references.
179 179
180 >>> root = 'http://some.svn.server/svn/some_repo' 180 >>> root = 'http://some.svn.server/svn/some_repo'
181 >>> resolvesource(None, root, 'http://other.svn.server') 181 >>> resolvesource(None, root, 'http://other.svn.server')
182 'http://other.svn.server' 182 'http://other.svn.server'
183 >>> resolvesource(None, root, 'ssh://other.svn.server') 183 >>> resolvesource(None, root, 'ssh://other.svn.server')
184 'ssh://other.svn.server' 184 'ssh://other.svn.server'
521 def basestate(self): 521 def basestate(self):
522 # basestate() was introduced by bcb973abcc0b in 2.2 522 # basestate() was introduced by bcb973abcc0b in 2.2
523 if self._state[1] == 'HEAD': 523 if self._state[1] == 'HEAD':
524 return 'HEAD' 524 return 'HEAD'
525 return super(svnsubrepo, self).basestate() 525 return super(svnsubrepo, self).basestate()
526 526
527 if __name__ == "__main__": 527 if __name__ == "__main__":
528 import doctest 528 import doctest
529 doctest.testmod() 529 doctest.testmod()