From 6c05c798b71320a4dafe1cf602851e327e9f4d07 Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Wed, 6 May 2015 11:06:44 -0700 Subject: [PATCH] push: refactor to a try/except for testing for svn --- remotenames.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/remotenames.py b/remotenames.py index f1786fbf88..2c43ac7e8b 100644 --- a/remotenames.py +++ b/remotenames.py @@ -503,9 +503,13 @@ def expushcmd(orig, ui, repo, dest=None, **opts): if not origdest and dest == 'default' and 'default-push' in paths: dest = 'default-push' - # hgsubversion does funcky things on push. Just call it directly - if dest in paths and paths[dest].startswith('svn+'): - orig(ui, repo, dest, **opts) + try: + # hgsubversion does funcky things on push. Just call it directly + path = paths[dest] + if path.startswith('svn+'): + orig(ui, repo, dest, **opts) + except KeyError: + pass if not to: if ui.configbool('remotenames', 'forceto', False):