Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 4699:a6b62584d0b2
unbundle: accept multiple file arguments
update test-bundle for multiple unbundle support
author | Giorgos Keramidas <keramida@ceid.upatras.gr> |
---|---|
date | Sun, 24 Jun 2007 10:08:38 -0500 |
parents | 5b2d986de0f8 |
children | 934275cd4526 |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Jun 24 07:22:58 2007 -0700 +++ b/mercurial/commands.py Sun Jun 24 10:08:38 2007 -0500 @@ -2614,18 +2614,22 @@ """ cmdutil.show_changeset(ui, repo, opts).show(nullrev+repo.changelog.count()) -def unbundle(ui, repo, fname, **opts): - """apply a changegroup file - - Apply a compressed changegroup file generated by the bundle - command. +def unbundle(ui, repo, fname1, *fnames, **opts): + """apply one or more changegroup files + + Apply one or more compressed changegroup files generated by the + bundle command. """ - if os.path.exists(fname): - f = open(fname, "rb") - else: - f = urllib.urlopen(fname) - gen = changegroup.readbundle(f, fname) - modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) + fnames = (fname1,) + fnames + result = None + for fname in fnames: + if os.path.exists(fname): + f = open(fname, "rb") + else: + f = urllib.urlopen(fname) + gen = changegroup.readbundle(f, fname) + modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) + return postincoming(ui, repo, modheads, opts['update']) def update(ui, repo, node=None, rev=None, clean=False, date=None): @@ -3079,7 +3083,7 @@ (unbundle, [('u', 'update', None, _('update to new tip if changesets were unbundled'))], - _('hg unbundle [-u] FILE')), + _('hg unbundle [-u] FILE...')), "^update|up|checkout|co": (update, [('C', 'clean', None, _('overwrite locally modified files')),