@ -360,10 +360,11 @@ class Mirror(object):
for fetchspec in config_fetchspecs . splitlines ( ) :
self . fetch_specs . add ( self . parse_fetch_spec ( fetchspec ) )
except subprocess . CalledProcessError :
logging . warn ( ' Tried and failed to preserve remote.origin.fetch from the '
' existing cache directory. You may need to manually edit '
' %s and " git cache fetch " again. '
% os . path . join ( self . mirror_path , ' config ' ) )
logging . warning (
' Tried and failed to preserve remote.origin.fetch from the '
' existing cache directory. You may need to manually edit '
' %s and " git cache fetch " again. ' %
os . path . join ( self . mirror_path , ' config ' ) )
def _ensure_bootstrapped (
self , depth , bootstrap , reset_fetch_config , force = False ) :
@ -381,7 +382,7 @@ class Mirror(object):
if not should_bootstrap :
if depth and os . path . exists ( os . path . join ( self . mirror_path , ' shallow ' ) ) :
logging . warn (
logging . warn ing (
' Shallow fetch requested, but repo cache already exists. ' )
return
@ -408,10 +409,10 @@ class Mirror(object):
self . RunGit ( [ ' init ' , ' --bare ' ] , cwd = self . mirror_path )
else :
# Bootstrap failed, previous cache exists; warn and continue.
logging . warn (
logging . warn ing (
' Git cache has a lot of pack files ( %d ). Tried to re-bootstrap '
' but failed. Continuing with non-optimized repository. '
% len ( pack_files ) )
' but failed. Continuing with non-optimized repository. ' %
len ( pack_files ) )
def _fetch ( self ,
rundir ,
@ -444,7 +445,7 @@ class Mirror(object):
except subprocess . CalledProcessError :
if spec == ' +refs/heads/*:refs/heads/* ' :
raise ClobberNeeded ( ) # Corrupted cache.
logging . warn ( ' Fetch of %s failed ' % spec )
logging . warn ing ( ' Fetch of %s failed ' % spec )
def populate ( self ,
depth = None ,
@ -565,9 +566,9 @@ class Mirror(object):
f = os . path . join ( pack_dir , f )
try :
os . remove ( f )
logging . warn ( ' Deleted stale temporary pack file %s ' % f )
logging . warn ing ( ' Deleted stale temporary pack file %s ' % f )
except OSError :
logging . warn ( ' Unable to delete temporary pack file %s ' % f )
logging . warn ing ( ' Unable to delete temporary pack file %s ' % f )
@subcommand.usage ( ' [url of repo to check for caching] ' )
@ -772,7 +773,7 @@ class OptionParser(optparse.OptionParser):
if global_cache_dir and (
os . path . abspath ( options . cache_dir ) !=
os . path . abspath ( global_cache_dir ) ) :
logging . warn ( ' Overriding globally-configured cache directory. ' )
logging . warn ing ( ' Overriding globally-configured cache directory. ' )
Mirror . SetCachePath ( options . cache_dir )
return options , args