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>
This commit is contained in:
Felipe Contreras 2013-05-24 21:30:00 -05:00 committed by Junio C Hamano
parent 42cbbcc73b
commit 8316d18da3
2 changed files with 9 additions and 3 deletions

View File

@ -116,7 +116,10 @@ class Marks:
self.last_mark = mark self.last_mark = mark
def get_tip(self, branch): 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): def set_tip(self, branch, tip):
self.tips[branch] = tip self.tips[branch] = tip

View File

@ -165,7 +165,7 @@ class Marks:
return self.marks[rev] return self.marks[rev]
def to_rev(self, mark): def to_rev(self, mark):
return self.rev_marks[mark] return str(self.rev_marks[mark])
def next_mark(self): def next_mark(self):
self.last_mark += 1 self.last_mark += 1
@ -185,7 +185,10 @@ class Marks:
return rev in self.marks return rev in self.marks
def get_tip(self, branch): 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): def set_tip(self, branch, tip):
self.tips[branch] = tip self.tips[branch] = tip