summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Felipe Contreras <felipe.contreras@gmail.com>2013-04-11 07:23:10 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-11 10:46:47 -0700
commitcbf6237c2ba989794815f980af1d26860840daf6 (patch)
treee9ad55c925b6f42237712cff3f80d2c0e1d25a06 /contrib
parentremote-hg: force remote push (diff)
downloadtgif-cbf6237c2ba989794815f980af1d26860840daf6.tar.xz
remote-hg: show more proper errors
When cloning or pushing fails, we don't want to show a stack-trace. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-hg12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index ff8972579e..3ae3598a2b 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -9,7 +9,7 @@
# Then you can clone with:
# git clone hg::/path/to/mercurial/repo/
-from mercurial import hg, ui, bookmarks, context, util, encoding, node
+from mercurial import hg, ui, bookmarks, context, util, encoding, node, error
import re
import sys
@@ -284,11 +284,17 @@ def get_repo(url, alias):
else:
local_path = os.path.join(dirname, 'clone')
if not os.path.exists(local_path):
- peer, dstpeer = hg.clone(myui, {}, url, local_path, update=False, pull=True)
+ try:
+ peer, dstpeer = hg.clone(myui, {}, url, local_path, update=True, pull=True)
+ except:
+ die('Repository error')
repo = dstpeer.local()
else:
repo = hg.repository(myui, local_path)
- peer = hg.peer(myui, {}, url)
+ try:
+ peer = hg.peer(myui, {}, url)
+ except:
+ die('Repository error')
repo.pull(peer, heads=None, force=True)
return repo