52 pass |
52 pass |
53 |
53 |
54 def getrepopath(cvspath): |
54 def getrepopath(cvspath): |
55 """Return the repository path from a CVS path. |
55 """Return the repository path from a CVS path. |
56 |
56 |
57 >>> getrepopath('/foo/bar') |
57 >>> getrepopath(b'/foo/bar') |
58 '/foo/bar' |
58 '/foo/bar' |
59 >>> getrepopath('c:/foo/bar') |
59 >>> getrepopath(b'c:/foo/bar') |
60 '/foo/bar' |
60 '/foo/bar' |
61 >>> getrepopath(':pserver:10/foo/bar') |
61 >>> getrepopath(b':pserver:10/foo/bar') |
62 '/foo/bar' |
62 '/foo/bar' |
63 >>> getrepopath(':pserver:10c:/foo/bar') |
63 >>> getrepopath(b':pserver:10c:/foo/bar') |
64 '/foo/bar' |
64 '/foo/bar' |
65 >>> getrepopath(':pserver:/foo/bar') |
65 >>> getrepopath(b':pserver:/foo/bar') |
66 '/foo/bar' |
66 '/foo/bar' |
67 >>> getrepopath(':pserver:c:/foo/bar') |
67 >>> getrepopath(b':pserver:c:/foo/bar') |
68 '/foo/bar' |
68 '/foo/bar' |
69 >>> getrepopath(':pserver:truc@foo.bar:/foo/bar') |
69 >>> getrepopath(b':pserver:truc@foo.bar:/foo/bar') |
70 '/foo/bar' |
70 '/foo/bar' |
71 >>> getrepopath(':pserver:truc@foo.bar:c:/foo/bar') |
71 >>> getrepopath(b':pserver:truc@foo.bar:c:/foo/bar') |
72 '/foo/bar' |
72 '/foo/bar' |
73 >>> getrepopath('user@server/path/to/repository') |
73 >>> getrepopath(b'user@server/path/to/repository') |
74 '/path/to/repository' |
74 '/path/to/repository' |
75 """ |
75 """ |
76 # According to CVS manual, CVS paths are expressed like: |
76 # According to CVS manual, CVS paths are expressed like: |
77 # [:method:][[user][:password]@]hostname[:[port]]/path/to/repository |
77 # [:method:][[user][:password]@]hostname[:[port]]/path/to/repository |
78 # |
78 # |