##// END OF EJS Templates
unbundle: accept multiple file arguments...
Giorgos Keramidas -
r4699:a6b62584 default
parent child Browse files
Show More
@@ -2614,18 +2614,22 b' def tip(ui, repo, **opts):'
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):
@@ -3079,7 +3083,7 b' table = {'
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')),
@@ -62,6 +62,13 b' hg -R bundle://../full.hg outgoing ../pa'
62 hg -R bundle://../does-not-exist.hg outgoing ../partial2
62 hg -R bundle://../does-not-exist.hg outgoing ../partial2
63 cd ..
63 cd ..
64
64
65 # test for http://www.selenic.com/mercurial/bts/issue216
66 rm -r empty
67 hg init empty
68 hg -R test bundle --base null -r 0 ../0.hg
69 hg -R test bundle --base 0 -r 1 ../1.hg
70 hg -R empty unbundle -u ../0.hg ../1.hg
71
65 # test for 540d1059c802
72 # test for 540d1059c802
66 hg init orig
73 hg init orig
67 cd orig
74 cd orig
@@ -211,6 +211,15 b' date: Mon Jan 12 13:46:40 1970 +0'
211 summary: 0.3m
211 summary: 0.3m
212
212
213 abort: No such file or directory: ../does-not-exist.hg
213 abort: No such file or directory: ../does-not-exist.hg
214 adding changesets
215 adding manifests
216 adding file changes
217 added 1 changesets with 1 changes to 1 files
218 adding changesets
219 adding manifests
220 adding file changes
221 added 1 changesets with 1 changes to 1 files
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 searching for changes
224 searching for changes
216 comparing with ../bundle.hg
225 comparing with ../bundle.hg
@@ -161,7 +161,7 b' list of commands:'
161 tag add a tag for the current or given revision
161 tag add a tag for the current or given revision
162 tags list repository tags
162 tags list repository tags
163 tip show the tip revision
163 tip show the tip revision
164 unbundle apply a changegroup file
164 unbundle apply one or more changegroup files
165 update update working directory
165 update update working directory
166 verify verify the integrity of the repository
166 verify verify the integrity of the repository
167 version output version and copyright information
167 version output version and copyright information
@@ -213,7 +213,7 b' list of commands:'
213 tag add a tag for the current or given revision
213 tag add a tag for the current or given revision
214 tags list repository tags
214 tags list repository tags
215 tip show the tip revision
215 tip show the tip revision
216 unbundle apply a changegroup file
216 unbundle apply one or more changegroup files
217 update update working directory
217 update update working directory
218 verify verify the integrity of the repository
218 verify verify the integrity of the repository
219 version output version and copyright information
219 version output version and copyright information
@@ -84,7 +84,7 b' list of commands:'
84 tag add a tag for the current or given revision
84 tag add a tag for the current or given revision
85 tags list repository tags
85 tags list repository tags
86 tip show the tip revision
86 tip show the tip revision
87 unbundle apply a changegroup file
87 unbundle apply one or more changegroup files
88 update update working directory
88 update update working directory
89 verify verify the integrity of the repository
89 verify verify the integrity of the repository
90 version output version and copyright information
90 version output version and copyright information
@@ -132,7 +132,7 b' use "hg -v help" to show aliases and glo'
132 tag add a tag for the current or given revision
132 tag add a tag for the current or given revision
133 tags list repository tags
133 tags list repository tags
134 tip show the tip revision
134 tip show the tip revision
135 unbundle apply a changegroup file
135 unbundle apply one or more changegroup files
136 update update working directory
136 update update working directory
137 verify verify the integrity of the repository
137 verify verify the integrity of the repository
138 version output version and copyright information
138 version output version and copyright information
General Comments 0
You need to be logged in to leave comments. Login now