Mercurial > hg
comparison hgext/patchbomb.py @ 14319:b33f3e35efb0
scmutil: move revsingle/pair/range from cmdutil
This allows users at levels below the command layer to avoid import loops.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 13 May 2011 14:06:28 -0500 |
parents | 37e80214badf |
children | 0368ad7963be |
comparison
equal
deleted
inserted
replaced
14318:1f46be4689ed | 14319:b33f3e35efb0 |
---|---|
47 | 47 |
48 import os, errno, socket, tempfile, cStringIO, time | 48 import os, errno, socket, tempfile, cStringIO, time |
49 import email.MIMEMultipart, email.MIMEBase | 49 import email.MIMEMultipart, email.MIMEBase |
50 import email.Utils, email.Encoders, email.Generator | 50 import email.Utils, email.Encoders, email.Generator |
51 from mercurial import cmdutil, commands, hg, mail, patch, util, discovery | 51 from mercurial import cmdutil, commands, hg, mail, patch, util, discovery |
52 from mercurial import scmutil | |
52 from mercurial.i18n import _ | 53 from mercurial.i18n import _ |
53 from mercurial.node import bin | 54 from mercurial.node import bin |
54 | 55 |
55 cmdtable = {} | 56 cmdtable = {} |
56 command = cmdutil.command(cmdtable) | 57 command = cmdutil.command(cmdtable) |
284 ui.status(_("no changes found\n")) | 285 ui.status(_("no changes found\n")) |
285 return [] | 286 return [] |
286 return [str(repo.changelog.rev(r)) for r in o] | 287 return [str(repo.changelog.rev(r)) for r in o] |
287 | 288 |
288 def getpatches(revs): | 289 def getpatches(revs): |
289 for r in cmdutil.revrange(repo, revs): | 290 for r in scmutil.revrange(repo, revs): |
290 output = cStringIO.StringIO() | 291 output = cStringIO.StringIO() |
291 cmdutil.export(repo, [r], fp=output, | 292 cmdutil.export(repo, [r], fp=output, |
292 opts=patch.diffopts(ui, opts)) | 293 opts=patch.diffopts(ui, opts)) |
293 yield output.getvalue().split('\n') | 294 yield output.getvalue().split('\n') |
294 | 295 |