def __new__(cls, path, rev=None, auth=None): self = object.__new__(cls) if isinstance(path, cls): rev = path.rev auth = path.auth path = path.strpath svncommon.checkbadchars(path) path = path.rstrip('/') self.strpath = path self.rev = rev self.auth = auth return self
def __new__(cls, path, rev=None, auth=None): self = object.__new__(cls) if isinstance(path, cls): rev = path.rev auth = path.auth path = path.strpath svncommon.checkbadchars(path) path = path.rstrip("/") self.strpath = path self.rev = rev self.auth = auth return self
def __new__(cls, path, rev=None): self = object.__new__(cls) if isinstance(path, cls): rev = path.rev path = path.strpath proto, uri = path.split("://", 1) host, uripath = uri.split('/', 1) # only check for bad chars in the non-protocol parts if (svncommon._check_for_bad_chars(host, svncommon.ALLOWED_CHARS_HOST) or svncommon._check_for_bad_chars(uripath, svncommon.ALLOWED_CHARS)): raise ValueError("bad char in path %s" % (path, )) path = path.rstrip('/') self.strpath = path self.rev = rev return self