# 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 -r e37786b29bed -r f1622b4f467d mercurial/commands.py --- a/mercurial/commands.py Tue Jan 30 18:32:20 2007 -0200 +++ b/mercurial/commands.py Tue Jan 30 18:32:21 2007 -0200 @@ -2490,7 +2490,11 @@ 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'])