Kaydet (Commit) c578d4c8 authored tarafından Eray Özkural's avatar Eray Özkural

* use None for filesize if can't read

* get_file_hashes: warn if we're ignoring directory 
üst 95fee7b0
......@@ -375,7 +375,7 @@ class Builder:
try: # broken links can cause problem
fsize = str(os.path.getsize(fpath))
except OSError:
fsize = "0"
fsize = None
d[frpath] = FileInfo(frpath, ftype, fsize, fhash)
for (p, fileinfo) in d.iteritems():
files.append(fileinfo)
......
......@@ -67,8 +67,6 @@ class FileInfo:
err = Checks()
err.has_tag(self.path, "File", "Path")
err.has_tag(self.type, "File", "Type")
err.has_tag(self.size, "File", "Size")
#err.has_tag(self.hash, "File", "SHA1Sum")
return err.list
def __str__(self):
......
......@@ -282,8 +282,10 @@ def get_file_hashes(top, exclude_prefix=None, removePrefix=None):
except FileError, e:
if os.path.islink(f):
ctx.ui.warning(_('Ignoring "external" link %s') % f)
# else:
# raise e
elif os.path.isdir(f):
ctx.ui.warning(_('Ignoring directory %s') % f)
else:
raise e
return None
# also handle single files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment