summaryrefslogtreecommitdiff
path: root/git/refs/log.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-07 14:44:02 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-07 14:44:02 +0100
commit73790919dbe038285a3612a191c377bc27ae6170 (patch)
treeced3af491a2b4354c15fb161102e9704d180d8d4 /git/refs/log.py
parent45eb728554953fafcee2aab0f76ca65e005326b0 (diff)
parentb6ed8d46c72366e111b9a97a7c238ef4af3bf4dc (diff)
downloadgitpython-73790919dbe038285a3612a191c377bc27ae6170.tar.gz
Merge branch 'commit_by_actor' of https://github.com/firm1/GitPython into firm1-commit_by_actor
Diffstat (limited to 'git/refs/log.py')
-rw-r--r--git/refs/log.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/git/refs/log.py b/git/refs/log.py
index 8ce98d30..ec19c1e8 100644
--- a/git/refs/log.py
+++ b/git/refs/log.py
@@ -32,7 +32,6 @@ __all__ = ["RefLog", "RefLogEntry"]
class RefLogEntry(tuple):
"""Named tuple allowing easy access to the revlog data fields"""
- _fmt = "%s %s %s <%s> %i %s\t%s\n"
_re_hexsha_only = re.compile('^[0-9A-Fa-f]{40}$')
__slots__ = tuple()
@@ -40,8 +39,13 @@ class RefLogEntry(tuple):
"""Representation of ourselves in git reflog format"""
act = self.actor
time = self.time
- return self._fmt % (self.oldhexsha, self.newhexsha, act.name, act.email,
- time[0], altz_to_utctz_str(time[1]), self.message)
+ return u"{0} {1} {2} <{3}> {4!s} {5}\t{6}\n".format(self.oldhexsha,
+ self.newhexsha,
+ act.name,
+ act.email,
+ time[0],
+ altz_to_utctz_str(time[1]),
+ self.message).encode("utf-8")
@property
def oldhexsha(self):
@@ -267,7 +271,6 @@ class RefLog(list, Serializable):
lf = LockFile(filepath)
lf._obtain_lock_or_raise()
-
fd = open(filepath, 'ab')
try:
fd.write(repr(entry).encode(defenc))