# HG changeset patch # User Alexis S. L. Carvalho # Date 1170189141 7200 # Node ID f1622b4f467dd6434b8dc8c409358582fe1081cc # Parent e37786b29bedaae173b9549dd447e658fd6497ef unbundle: don't use urllib if it's a local file diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2490,7 +2490,11 @@ def unbundle(ui, repo, fname, **opts): Apply a compressed changegroup file generated by the bundle command. """ - gen = changegroup.readbundle(urllib.urlopen(fname), fname) + if os.path.exists(fname): + f = open(fname) + else: + f = urllib.urlopen(fname) + gen = changegroup.readbundle(f, fname) modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) return postincoming(ui, repo, modheads, opts['update'])