Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 3547:891c8d20f80f
mq: support qimport -
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Thu, 26 Oct 2006 09:40:20 -0700 |
parents | fbf8320f25c8 |
children | 23f7d9621783 |
line wrap: on
line diff
--- a/hgext/mq.py Wed Oct 25 20:59:50 2006 +0200 +++ b/hgext/mq.py Thu Oct 26 09:40:20 2006 -0700 @@ -1337,13 +1337,20 @@ for filename in files: if existing: + if filename == '-': + raise util.Abort(_('-e is incompatible with import from -')) if not patchname: patchname = filename if not os.path.isfile(self.join(patchname)): raise util.Abort(_("patch %s does not exist") % patchname) else: try: - text = file(filename).read() + if filename == '-': + if not patchname: + raise util.Abort(_('need --name to import a patch from -')) + text = sys.stdin.read() + else: + text = file(filename).read() except IOError: raise util.Abort(_("unable to read %s") % patchname) if not patchname: