summaryrefslogtreecommitdiff
path: root/contrib/remote-helpers
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-25 02:30:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-28 15:02:24 (GMT)
commit8316d18da324f44b93faf36cddbf19411b53d101 (patch)
treeec3e4ad9a810b32e1fd56dbf06654ae1fc9aebd9 /contrib/remote-helpers
parent42cbbcc73b312e2306f051f89702799546aa7953 (diff)
downloadgit-8316d18da324f44b93faf36cddbf19411b53d101.zip
git-8316d18da324f44b93faf36cddbf19411b53d101.tar.gz
git-8316d18da324f44b93faf36cddbf19411b53d101.tar.bz2
remote-helpers: improve marks usage
Always convert to strings (they are unicode because they come from JSON). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/remote-helpers')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr5
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg7
2 files changed, 9 insertions, 3 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index 10300c6..f0e5be1 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 bd545aa..1e61f43 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