Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 4056:f1622b4f467d
unbundle: don't use urllib if it's a local file
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Tue, 30 Jan 2007 18:32:21 -0200 |
parents | e37786b29bed |
children | 431f3c1d3a37 96863fc3036a |
comparison
equal
deleted
inserted
replaced
4055:e37786b29bed | 4056:f1622b4f467d |
---|---|
2488 """apply a changegroup file | 2488 """apply a changegroup file |
2489 | 2489 |
2490 Apply a compressed changegroup file generated by the bundle | 2490 Apply a compressed changegroup file generated by the bundle |
2491 command. | 2491 command. |
2492 """ | 2492 """ |
2493 gen = changegroup.readbundle(urllib.urlopen(fname), fname) | 2493 if os.path.exists(fname): |
2494 f = open(fname) | |
2495 else: | |
2496 f = urllib.urlopen(fname) | |
2497 gen = changegroup.readbundle(f, fname) | |
2494 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | 2498 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) |
2495 return postincoming(ui, repo, modheads, opts['update']) | 2499 return postincoming(ui, repo, modheads, opts['update']) |
2496 | 2500 |
2497 def update(ui, repo, node=None, clean=False, branch=None, date=None): | 2501 def update(ui, repo, node=None, clean=False, branch=None, date=None): |
2498 """update working directory | 2502 """update working directory |