@@ -49,14 +49,22 @@ def fetch_new(
49
49
flag = ""
50
50
else :
51
51
flag = f"-{ 'v' * verbosity } "
52
- cmd_args = make_command ("branch" , flag , rev_options .to_args (), url , dest )
52
+ cmd_args = make_command (
53
+ "checkout" , "--lightweight" , flag , rev_options .to_args (), url , dest
54
+ )
53
55
self .run_command (cmd_args )
54
56
55
57
def switch (self , dest : str , url : HiddenText , rev_options : RevOptions ) -> None :
56
58
self .run_command (make_command ("switch" , url ), cwd = dest )
57
59
58
60
def update (self , dest : str , url : HiddenText , rev_options : RevOptions ) -> None :
59
- cmd_args = make_command ("pull" , "-q" , rev_options .to_args ())
61
+ if not os .path .exists (os .path .join (dest , '.bzr' , 'branch' , 'location' )):
62
+ # Older versions of pip used to create standalone branches.
63
+ # Convert the standalone branch to a checkout by calling "bzr bind".
64
+ cmd_args = make_command ("bind" , "-q" , url )
65
+ self .run_command (cmd_args , cwd = dest )
66
+
67
+ cmd_args = make_command ("update" , "-q" , rev_options .to_args ())
60
68
self .run_command (cmd_args , cwd = dest )
61
69
62
70
@classmethod
0 commit comments