From: Felipe Contreras Date: Sat, 25 May 2013 02:30:00 +0000 (-0500) Subject: remote-helpers: improve marks usage X-Git-Tag: v1.8.4-rc0~191^2~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8316d18da324f44b93faf36cddbf19411b53d101?ds=inline;hp=--cc remote-helpers: improve marks usage Always convert to strings (they are unicode because they come from JSON). Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- 8316d18da324f44b93faf36cddbf19411b53d101 diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index 10300c63d1..f0e5be1d24 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -116,7 +116,10 @@ class Marks: self.last_mark = mark def get_tip(self, branch): - return self.tips.get(branch, None) + try: + return str(self.tips[branch]) + except KeyError: + return None def set_tip(self, branch, tip): self.tips[branch] = tip diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg index bd545aa380..1e61f4327a 100755 --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@ -165,7 +165,7 @@ class Marks: return self.marks[rev] def to_rev(self, mark): - return self.rev_marks[mark] + return str(self.rev_marks[mark]) def next_mark(self): self.last_mark += 1 @@ -185,7 +185,10 @@ class Marks: return rev in self.marks def get_tip(self, branch): - return self.tips.get(branch, None) + try: + return str(self.tips[branch]) + except KeyError: + return None def set_tip(self, branch, tip): self.tips[branch] = tip