@@ -89,20 +89,20 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
89
89
if e .errno == errno .ENOENT :
90
90
continue
91
91
if verbose :
92
- print ("unable to run %s" % dispcmd )
93
- print (e )
92
+ print ("unable to run %s" % dispcmd )
93
+ print (e )
94
94
return None , None
95
95
else :
96
96
if verbose :
97
- print ("unable to find command, tried %s" % (commands ,))
97
+ print ("unable to find command, tried %s" % (commands ,))
98
98
return None , None
99
99
stdout = p .communicate ()[0 ].strip ()
100
100
if sys .version_info [0 ] >= 3 :
101
101
stdout = stdout .decode ()
102
102
if p .returncode != 0 :
103
103
if verbose :
104
- print ("unable to run %s (error)" % dispcmd )
105
- print ("stdout was %s" % stdout )
104
+ print ("unable to run %s (error)" % dispcmd )
105
+ print ("stdout was %s" % stdout )
106
106
return None , p .returncode
107
107
return stdout , p .returncode
108
108
@@ -131,7 +131,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
131
131
root = os .path .dirname (root ) # up a level
132
132
133
133
if verbose :
134
- print (
134
+ print (
135
135
"Tried directories %s but none started with prefix %s"
136
136
% (str (rootdirs ), parentdir_prefix )
137
137
)
@@ -184,7 +184,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
184
184
refnames = keywords ["refnames" ].strip ()
185
185
if refnames .startswith ("$Format" ):
186
186
if verbose :
187
- print ("keywords are unexpanded, not using" )
187
+ print ("keywords are unexpanded, not using" )
188
188
raise NotThisMethod ("unexpanded keywords, not a git-archive tarball" )
189
189
refs = set ([r .strip () for r in refnames .strip ("()" ).split ("," )])
190
190
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
@@ -201,15 +201,15 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
201
201
# "stabilization", as well as "HEAD" and "master".
202
202
tags = set ([r for r in refs if re .search (r"\d" , r )])
203
203
if verbose :
204
- print ("discarding '%s', no digits" % "," .join (refs - tags ))
204
+ print ("discarding '%s', no digits" % "," .join (refs - tags ))
205
205
if verbose :
206
- print ("likely tags: %s" % "," .join (sorted (tags )))
206
+ print ("likely tags: %s" % "," .join (sorted (tags )))
207
207
for ref in sorted (tags ):
208
208
# sorting will prefer e.g. "2.0" over "2.0rc1"
209
209
if ref .startswith (tag_prefix ):
210
210
r = ref [len (tag_prefix ) :]
211
211
if verbose :
212
- print ("picking %s" % r )
212
+ print ("picking %s" % r )
213
213
return {
214
214
"version" : r ,
215
215
"full-revisionid" : keywords ["full" ].strip (),
@@ -219,7 +219,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
219
219
}
220
220
# no suitable tags, so version is "0+unknown", but full hex is still there
221
221
if verbose :
222
- print ("no suitable tags, using unknown + full revision id" )
222
+ print ("no suitable tags, using unknown + full revision id" )
223
223
return {
224
224
"version" : "0+unknown" ,
225
225
"full-revisionid" : keywords ["full" ].strip (),
@@ -244,7 +244,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
244
244
out , rc = run_command (GITS , ["rev-parse" , "--git-dir" ], cwd = root , hide_stderr = True )
245
245
if rc != 0 :
246
246
if verbose :
247
- print ("Directory %s not under git control" % root )
247
+ print ("Directory %s not under git control" % root )
248
248
raise NotThisMethod ("'git rev-parse --git-dir' returned error" )
249
249
250
250
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
@@ -301,7 +301,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
301
301
if not full_tag .startswith (tag_prefix ):
302
302
if verbose :
303
303
fmt = "tag '%s' doesn't start with prefix '%s'"
304
- print (fmt % (full_tag , tag_prefix ))
304
+ print (fmt % (full_tag , tag_prefix ))
305
305
pieces ["error" ] = "tag '%s' doesn't start with prefix '%s'" % (
306
306
full_tag ,
307
307
tag_prefix ,
0 commit comments