summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-16 08:25:57 -0700
committerShawn O. Pearce <sop@google.com>2009-04-16 08:25:57 -0700
commit48244781c2cad1565b4b32b4524ff9931a39f848 (patch)
treed408008547b22af4141ba4593064bda618e04ab7
parent19a83d80854d88f079f8d6530812b50948f0e28c (diff)
downloadgit-repo-48244781c2cad1565b4b32b4524ff9931a39f848.tar.gz
Refactor error message display in project.py
Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r--project.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/project.py b/project.py
index 6ffbd023..33cb3444 100644
--- a/project.py
+++ b/project.py
@@ -34,6 +34,10 @@ R_TAGS = 'refs/tags/'
34R_PUB = 'refs/published/' 34R_PUB = 'refs/published/'
35R_M = 'refs/remotes/m/' 35R_M = 'refs/remotes/m/'
36 36
37def _error(fmt, *args):
38 msg = fmt % args
39 print >>sys.stderr, 'error: %s' % msg
40
37def _warn(fmt, *args): 41def _warn(fmt, *args):
38 msg = fmt % args 42 msg = fmt % args
39 print >>sys.stderr, 'warn: %s' % msg 43 print >>sys.stderr, 'warn: %s' % msg
@@ -199,9 +203,7 @@ class _CopyFile:
199 mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH) 203 mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
200 os.chmod(dest, mode) 204 os.chmod(dest, mode)
201 except IOError: 205 except IOError:
202 print >>sys.stderr, \ 206 _error('Cannot copy file %s to %s', src, dest)
203 'error: Cannot copy file %s to %s' \
204 % (src, dest)
205 207
206 208
207class Project(object): 209class Project(object):