-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathremote.py
41 lines (29 loc) · 882 Bytes
/
remote.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import svn.constants
import svn.common
class RemoteClient(svn.common.CommonClient):
def __init__(self, url, *args, **kwargs):
super(RemoteClient, self).__init__(
url,
svn.constants.LT_URL,
*args, **kwargs)
def checkout(self, path, revision=None):
cmd = []
if revision is not None:
cmd += ['-r', str(revision)]
cmd += [self.url, path]
self.run_command('checkout', cmd)
def remove(self, rel_path, message, do_force=False):
args = [
'--message', message,
]
if do_force is True:
args.append('--force')
url = '{}/{}'.format(self.url, rel_path)
args += [
url
]
self.run_command(
'rm',
args)
def __repr__(self):
return '<SVN(REMOTE) %s>' % self.url