josn-jys / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

repo info -ob chokes if the log message contains % signs #131

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Affected Version: v1.12.0
Environment: Mac OS X

What steps will reproduce the problem?
1. Make a commit with a message that contains a % sign (e.g. "Implementing the 
%s specifier")
2. Call "repo info -o" to view the unmerged commit

What is the expected output? What do you see instead?
I expect to see the commit message. Instead, we get a traceback like this:
Traceback (most recent call last):
  File ".repo/repo/main.py", line 414, in <module>
    _Main(sys.argv[1:])
  File ".repo/repo/main.py", line 390, in _Main
    result = repo._Run(argv) or 0
  File ".repo/repo/main.py", line 138, in _Run
    result = cmd.Execute(copts, cargs)
  File ".repo/repo/subcmds/info.py", line 70, in Execute
    self.printCommitOverview(args)
  File ".repo/repo/subcmds/info.py", line 195, in printCommitOverview
    self.text(" ".join(split[1:]))
  File ".repo/repo/color.py", line 126, in f
    s._out.write(c(fmt, *args))
  File ".repo/repo/color.py", line 133, in f
    output = fmt % args
TypeError: not enough arguments for format string

Please provide any additional information below.
Simple patch:
diff --git a/subcmds/info.py b/subcmds/info.py
index 3a25e3b..da4475d 100644
--- a/subcmds/info.py
+++ b/subcmds/info.py
@@ -191,5 +191,5 @@ class Info(PagedCommand):
         split = commit.split()
         self.text('{0:38}{1} '.format('','-'))
         self.sha(split[0] + " ")
-        self.text("".join(split[1:]))
+        self.text("%s", " ".join(split[1:]))
         self.out.nl()

Original issue reported on code.google.com by nneon...@gmail.com on 2 Feb 2013 at 5:52

GoogleCodeExporter commented 9 years ago
https://gerrit-review.googlesource.com/#/c/42440/

Original comment by david.pu...@sonymobile.com on 18 Feb 2013 at 12:42

GoogleCodeExporter commented 9 years ago

Original comment by david.pu...@sonymobile.com on 27 Feb 2013 at 1:51