mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-11-11 21:55:40 +01:00
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:
@@ -185,10 +185,7 @@ class Marks:
|
|||||||
return rev in self.marks
|
return rev in self.marks
|
||||||
|
|
||||||
def get_tip(self, branch):
|
def get_tip(self, branch):
|
||||||
try:
|
return str(self.tips[branch])
|
||||||
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
|
||||||
@@ -433,10 +430,10 @@ def export_ref(repo, name, kind, head):
|
|||||||
global prefix, marks, mode
|
global prefix, marks, mode
|
||||||
|
|
||||||
ename = '%s/%s' % (kind, name)
|
ename = '%s/%s' % (kind, name)
|
||||||
tip = marks.get_tip(ename)
|
try:
|
||||||
if tip and tip in repo:
|
tip = marks.get_tip(ename)
|
||||||
tip = repo[tip].rev()
|
tip = repo[tip].rev()
|
||||||
else:
|
except:
|
||||||
tip = 0
|
tip = 0
|
||||||
|
|
||||||
revs = xrange(tip, head.rev() + 1)
|
revs = xrange(tip, head.rev() + 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user