mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Refactor error message display in project.py
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
19a83d8085
commit
48244781c2
@ -34,6 +34,10 @@ R_TAGS = 'refs/tags/'
|
|||||||
R_PUB = 'refs/published/'
|
R_PUB = 'refs/published/'
|
||||||
R_M = 'refs/remotes/m/'
|
R_M = 'refs/remotes/m/'
|
||||||
|
|
||||||
|
def _error(fmt, *args):
|
||||||
|
msg = fmt % args
|
||||||
|
print >>sys.stderr, 'error: %s' % msg
|
||||||
|
|
||||||
def _warn(fmt, *args):
|
def _warn(fmt, *args):
|
||||||
msg = fmt % args
|
msg = fmt % args
|
||||||
print >>sys.stderr, 'warn: %s' % msg
|
print >>sys.stderr, 'warn: %s' % msg
|
||||||
@ -199,9 +203,7 @@ class _CopyFile:
|
|||||||
mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
|
mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
|
||||||
os.chmod(dest, mode)
|
os.chmod(dest, mode)
|
||||||
except IOError:
|
except IOError:
|
||||||
print >>sys.stderr, \
|
_error('Cannot copy file %s to %s', src, dest)
|
||||||
'error: Cannot copy file %s to %s' \
|
|
||||||
% (src, dest)
|
|
||||||
|
|
||||||
|
|
||||||
class Project(object):
|
class Project(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user