comparison hgext/mq.py @ 3533:891c8d20f80f

mq: support qimport -
author Brendan Cully <brendan@kublai.com>
date Thu, 26 Oct 2006 09:40:20 -0700
parents fbf8320f25c8
children 23f7d9621783
comparison
equal deleted inserted replaced
3532:04d44c3d64f7 3533:891c8d20f80f
1335 self.parse_series() 1335 self.parse_series()
1336 self.applied_dirty = 1 1336 self.applied_dirty = 1
1337 1337
1338 for filename in files: 1338 for filename in files:
1339 if existing: 1339 if existing:
1340 if filename == '-':
1341 raise util.Abort(_('-e is incompatible with import from -'))
1340 if not patchname: 1342 if not patchname:
1341 patchname = filename 1343 patchname = filename
1342 if not os.path.isfile(self.join(patchname)): 1344 if not os.path.isfile(self.join(patchname)):
1343 raise util.Abort(_("patch %s does not exist") % patchname) 1345 raise util.Abort(_("patch %s does not exist") % patchname)
1344 else: 1346 else:
1345 try: 1347 try:
1346 text = file(filename).read() 1348 if filename == '-':
1349 if not patchname:
1350 raise util.Abort(_('need --name to import a patch from -'))
1351 text = sys.stdin.read()
1352 else:
1353 text = file(filename).read()
1347 except IOError: 1354 except IOError:
1348 raise util.Abort(_("unable to read %s") % patchname) 1355 raise util.Abort(_("unable to read %s") % patchname)
1349 if not patchname: 1356 if not patchname:
1350 patchname = os.path.basename(filename) 1357 patchname = os.path.basename(filename)
1351 checkfile(patchname) 1358 checkfile(patchname)