@@ -49,14 +49,24 @@ 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
+ output = self .run_command (
62
+ make_command ("info" ), show_stdout = False , stdout_only = True , cwd = dest )
63
+ if output .startswith ('Standalone ' ):
64
+ # Older versions of pip used to create standalone branches.
65
+ # Convert the standalone branch to a checkout by calling "bzr bind".
66
+ cmd_args = make_command ("bind" , "-q" , url )
67
+ self .run_command (cmd_args , cwd = dest )
68
+
69
+ cmd_args = make_command ("update" , "-q" , rev_options .to_args ())
60
70
self .run_command (cmd_args , cwd = dest )
61
71
62
72
@classmethod
0 commit comments