16
16
17
17
18
18
class Bazaar (VersionControl ):
19
- name = ' bzr'
20
- dirname = ' .bzr'
21
- repo_name = ' branch'
19
+ name = " bzr"
20
+ dirname = " .bzr"
21
+ repo_name = " branch"
22
22
schemes = (
23
- 'bzr+http' , 'bzr+https' , 'bzr+ssh' , 'bzr+sftp' , 'bzr+ftp' ,
24
- 'bzr+lp' , 'bzr+file'
23
+ "bzr+http" ,
24
+ "bzr+https" ,
25
+ "bzr+ssh" ,
26
+ "bzr+sftp" ,
27
+ "bzr+ftp" ,
28
+ "bzr+lp" ,
29
+ "bzr+file" ,
25
30
)
26
31
27
32
@staticmethod
28
33
def get_base_rev_args (rev : str ) -> List [str ]:
29
- return ['-r' , rev ]
34
+ return ["-r" , rev ]
30
35
31
36
def fetch_new (self , dest : str , url : HiddenText , rev_options : RevOptions ) -> None :
32
37
rev_display = rev_options .to_display ()
33
38
logger .info (
34
- ' Checking out %s%s to %s' ,
39
+ " Checking out %s%s to %s" ,
35
40
url ,
36
41
rev_display ,
37
42
display_path (dest ),
38
43
)
39
- cmd_args = (
40
- make_command ('branch' , '-q' , rev_options .to_args (), url , dest )
41
- )
44
+ cmd_args = make_command ("branch" , "-q" , rev_options .to_args (), url , dest )
42
45
self .run_command (cmd_args )
43
46
44
47
def switch (self , dest : str , url : HiddenText , rev_options : RevOptions ) -> None :
45
- self .run_command (make_command (' switch' , url ), cwd = dest )
48
+ self .run_command (make_command (" switch" , url ), cwd = dest )
46
49
47
50
def update (self , dest : str , url : HiddenText , rev_options : RevOptions ) -> None :
48
- cmd_args = make_command (' pull' , '-q' , rev_options .to_args ())
51
+ cmd_args = make_command (" pull" , "-q" , rev_options .to_args ())
49
52
self .run_command (cmd_args , cwd = dest )
50
53
51
54
@classmethod
52
55
def get_url_rev_and_auth (cls , url : str ) -> Tuple [str , Optional [str ], AuthInfo ]:
53
56
# hotfix the URL scheme after removing bzr+ from bzr+ssh:// readd it
54
57
url , rev , user_pass = super ().get_url_rev_and_auth (url )
55
- if url .startswith (' ssh://' ):
56
- url = ' bzr+' + url
58
+ if url .startswith (" ssh://" ):
59
+ url = " bzr+" + url
57
60
return url , rev , user_pass
58
61
59
62
@classmethod
60
63
def get_remote_url (cls , location : str ) -> str :
61
64
urls = cls .run_command (
62
- [' info' ], show_stdout = False , stdout_only = True , cwd = location
65
+ [" info" ], show_stdout = False , stdout_only = True , cwd = location
63
66
)
64
67
for line in urls .splitlines ():
65
68
line = line .strip ()
66
- for x in ('checkout of branch: ' ,
67
- 'parent branch: ' ):
69
+ for x in ("checkout of branch: " , "parent branch: " ):
68
70
if line .startswith (x ):
69
71
repo = line .split (x )[1 ]
70
72
if cls ._is_local_repository (repo ):
@@ -75,7 +77,10 @@ def get_remote_url(cls, location: str) -> str:
75
77
@classmethod
76
78
def get_revision (cls , location : str ) -> str :
77
79
revision = cls .run_command (
78
- ['revno' ], show_stdout = False , stdout_only = True , cwd = location ,
80
+ ["revno" ],
81
+ show_stdout = False ,
82
+ stdout_only = True ,
83
+ cwd = location ,
79
84
)
80
85
return revision .splitlines ()[- 1 ]
81
86
0 commit comments