diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2614,18 +2614,22 @@ def tip(ui, repo, **opts): """ 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 @@ table = { (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')),