remote-hg: trivial cleanup

It's better to catch the exception later on.

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:01 -05:00 committed by Junio C Hamano
parent 8316d18da3
commit ab64bc9d21

View File

@ -185,10 +185,7 @@ class Marks:
return rev in self.marks
def get_tip(self, branch):
try:
return str(self.tips[branch])
except KeyError:
return None
def set_tip(self, branch, tip):
self.tips[branch] = tip
@ -433,10 +430,10 @@ def export_ref(repo, name, kind, head):
global prefix, marks, mode
ename = '%s/%s' % (kind, name)
try:
tip = marks.get_tip(ename)
if tip and tip in repo:
tip = repo[tip].rev()
else:
except:
tip = 0
revs = xrange(tip, head.rev() + 1)