Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
4698:30e826bd8ed1 | 4699:a6b62584d0b2 |
---|---|
2612 | 2612 |
2613 Show the tip revision. | 2613 Show the tip revision. |
2614 """ | 2614 """ |
2615 cmdutil.show_changeset(ui, repo, opts).show(nullrev+repo.changelog.count()) | 2615 cmdutil.show_changeset(ui, repo, opts).show(nullrev+repo.changelog.count()) |
2616 | 2616 |
2617 def unbundle(ui, repo, fname, **opts): | 2617 def unbundle(ui, repo, fname1, *fnames, **opts): |
2618 """apply a changegroup file | 2618 """apply one or more changegroup files |
2619 | 2619 |
2620 Apply a compressed changegroup file generated by the bundle | 2620 Apply one or more compressed changegroup files generated by the |
2621 command. | 2621 bundle command. |
2622 """ | 2622 """ |
2623 if os.path.exists(fname): | 2623 fnames = (fname1,) + fnames |
2624 f = open(fname, "rb") | 2624 result = None |
2625 else: | 2625 for fname in fnames: |
2626 f = urllib.urlopen(fname) | 2626 if os.path.exists(fname): |
2627 gen = changegroup.readbundle(f, fname) | 2627 f = open(fname, "rb") |
2628 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | 2628 else: |
2629 f = urllib.urlopen(fname) | |
2630 gen = changegroup.readbundle(f, fname) | |
2631 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | |
2632 | |
2629 return postincoming(ui, repo, modheads, opts['update']) | 2633 return postincoming(ui, repo, modheads, opts['update']) |
2630 | 2634 |
2631 def update(ui, repo, node=None, rev=None, clean=False, date=None): | 2635 def update(ui, repo, node=None, rev=None, clean=False, date=None): |
2632 """update working directory | 2636 """update working directory |
2633 | 2637 |
3077 _('hg tip [-p]')), | 3081 _('hg tip [-p]')), |
3078 "unbundle": | 3082 "unbundle": |
3079 (unbundle, | 3083 (unbundle, |
3080 [('u', 'update', None, | 3084 [('u', 'update', None, |
3081 _('update to new tip if changesets were unbundled'))], | 3085 _('update to new tip if changesets were unbundled'))], |
3082 _('hg unbundle [-u] FILE')), | 3086 _('hg unbundle [-u] FILE...')), |
3083 "^update|up|checkout|co": | 3087 "^update|up|checkout|co": |
3084 (update, | 3088 (update, |
3085 [('C', 'clean', None, _('overwrite locally modified files')), | 3089 [('C', 'clean', None, _('overwrite locally modified files')), |
3086 ('d', 'date', '', _('tipmost revision matching date')), | 3090 ('d', 'date', '', _('tipmost revision matching date')), |
3087 ('r', 'rev', '', _('revision'))], | 3091 ('r', 'rev', '', _('revision'))], |