##// END OF EJS Templates
Add common bundle/outgoing options to hg email
John Goerzen -
r4279:126d1967 default
parent child Browse files
Show More
@@ -185,11 +185,11 b' def patchbomb(ui, repo, *revs, **opts):'
185 o = repo.changelog.nodesbetween(o, revs or None)[0]
185 o = repo.changelog.nodesbetween(o, revs or None)[0]
186 return [str(repo.changelog.rev(r)) for r in o]
186 return [str(repo.changelog.rev(r)) for r in o]
187
187
188 def getbundle(dest, revs):
188 def getbundle(dest):
189 tmpdir = tempfile.mkdtemp(prefix='hg-email-bundle-')
189 tmpdir = tempfile.mkdtemp(prefix='hg-email-bundle-')
190 tmpfn = os.path.join(tmpdir, 'bundle')
190 tmpfn = os.path.join(tmpdir, 'bundle')
191 try:
191 try:
192 commands.bundle(ui, repo, tmpfn, dest, *revs, **{'force': 0})
192 commands.bundle(ui, repo, tmpfn, dest, **opts)
193 return open(tmpfn).read()
193 return open(tmpfn).read()
194 finally:
194 finally:
195 try:
195 try:
@@ -216,6 +216,8 b' def patchbomb(ui, repo, *revs, **opts):'
216
216
217 if opts.get('outgoing'):
217 if opts.get('outgoing'):
218 revs = outgoing(dest, opts.get('rev'))
218 revs = outgoing(dest, opts.get('rev'))
219 if opts.get('bundle'):
220 opts['revs'] = revs
219
221
220 # start
222 # start
221 start_time = util.makedate()
223 start_time = util.makedate()
@@ -311,7 +313,7 b' def patchbomb(ui, repo, *revs, **opts):'
311 return [msg]
313 return [msg]
312
314
313 if opts.get('bundle'):
315 if opts.get('bundle'):
314 msgs = getbundlemsgs(getbundle(dest, revs))
316 msgs = getbundlemsgs(getbundle(dest))
315 else:
317 else:
316 msgs = getexportmsgs()
318 msgs = getexportmsgs()
317
319
@@ -380,6 +382,10 b' cmdtable = {'
380 ('b', 'bundle', None, _('send changes not in target as a binary bundle')),
382 ('b', 'bundle', None, _('send changes not in target as a binary bundle')),
381 ('r', 'rev', [], _('a revision to send')),
383 ('r', 'rev', [], _('a revision to send')),
382 ('s', 'subject', '', 'subject of first message (intro or single patch)'),
384 ('s', 'subject', '', 'subject of first message (intro or single patch)'),
383 ('t', 'to', [], 'email addresses of recipients')] + commands.remoteopts,
385 ('t', 'to', [], 'email addresses of recipients'),
386 ('', 'force', None, _('run even when remote repository is unrelated (with -b)')),
387 ('', 'base', [],
388 _('a base changeset to specify instead of a destination (with -b)'))]
389 + commands.remoteopts,
384 "hg email [OPTION]... [DEST]...")
390 "hg email [OPTION]... [DEST]...")
385 }
391 }
General Comments 0
You need to be logged in to leave comments. Login now