]> arthur.barton.de Git - bup.git/commitdiff
Improve formatting of error and warning messages.
authorAaron M. Ucko <amu@alum.mit.edu>
Mon, 30 May 2011 23:02:35 +0000 (19:02 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 31 May 2011 04:30:06 +0000 (00:30 -0400)
log() trailing newlines as appropriate.  Fix a format string typo in
lib/bup/git.py encountered when verifying that exceptions' string
values already end with newlines.

cmd/tag-cmd.py
lib/bup/drecurse.py
lib/bup/git.py
lib/bup/index.py

index bedd97c3504e5d9561cfa08e3f8ca8a7bb027ea8..17037b319b7c066f3ea15eec4411cbaa0ddeb1a3 100755 (executable)
@@ -29,7 +29,7 @@ if opt.delete:
     tag_file = git.repo('refs/tags/%s' % opt.delete)
     debug1("tag file: %s\n" % tag_file)
     if not os.path.exists(tag_file):
-        log("bup: error: tag '%s' not found." % opt.delete)
+        log("bup: error: tag '%s' not found.\n" % opt.delete)
         sys.exit(1)
 
     try:
@@ -55,7 +55,7 @@ if not tag_name:
 debug1("args: tag name = %s; commit = %s\n" % (tag_name, commit))
 
 if tag_name in tags:
-    log("bup: error: tag '%s' already exists" % tag_name)
+    log("bup: error: tag '%s' already exists\n" % tag_name)
     sys.exit(1)
 
 if tag_name.startswith('.'):
@@ -68,12 +68,12 @@ except git.GitError, e:
     sys.exit(2)
 
 if not hash:
-    log("bup: error: commit %s not found." % commit)
+    log("bup: error: commit %s not found.\n" % commit)
     sys.exit(2)
 
 pL = git.PackIdxList(git.repo('objects/pack'))
 if not pL.exists(hash):
-    log("bup: error: commit %s not found." % commit)
+    log("bup: error: commit %s not found.\n" % commit)
     sys.exit(2)
 
 tag_file = git.repo('refs/tags/%s' % tag_name)
index e0855c83197a241d50e79988ae0f5497d0cf68ad..866045ff680a313373d9e67d16a1756876412156 100644 (file)
@@ -132,7 +132,7 @@ def parse_excludes(flags):
                     for exclude_path in f.readlines():
                         excluded_paths.append(realpath(exclude_path.strip()))
                 except Error, e:
-                    log("warning: couldn't read %s" % parameter)
+                    log("warning: couldn't read %s\n" % parameter)
             finally:
                 f.close()
 
index 421c306480fc75e3991cc0ec84a33a0eec36bf1b..a86f80e5b151571cb432126abaf8f23a47bef04d 100644 (file)
@@ -821,7 +821,7 @@ def init_repo(path=None):
     if parent and not os.path.exists(parent):
         raise GitError('parent directory "%s" does not exist\n' % parent)
     if os.path.exists(d) and not os.path.isdir(os.path.join(d, '.')):
-        raise GitError('"%d" exists but is not a directory\n' % d)
+        raise GitError('"%s" exists but is not a directory\n' % d)
     p = subprocess.Popen(['git', '--bare', 'init'], stdout=sys.stderr,
                          preexec_fn = _gitenv)
     _git_wait('git init', p)
@@ -961,7 +961,7 @@ class CatPipe:
         assert(self.p)
         assert(self.p.poll() == None)
         if self.inprogress:
-            log('_fast_get: opening %r while %r is open'
+            log('_fast_get: opening %r while %r is open\n'
                 % (id, self.inprogress))
         assert(not self.inprogress)
         assert(id.find('\n') < 0)
index 0007bbc02c31023fb309446219447b20eaca79c2..8d2471e3eeac9138346cb2086ce4ef9d01be6a73 100644 (file)
@@ -271,7 +271,7 @@ class Reader:
         if f:
             b = f.read(len(INDEX_HDR))
             if b != INDEX_HDR:
-                log('warning: %s: header: expected %r, got %r'
+                log('warning: %s: header: expected %r, got %r\n'
                                  % (filename, INDEX_HDR, b))
             else:
                 st = os.fstat(f.fileno())