comparison hgext/mq.py @ 3568:23f7d9621783

Merge with upstream
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 27 Oct 2006 23:09:46 +0200
parents 891c8d20f80f 4d97184a06ad
children 3b4e00cba57a
comparison
equal deleted inserted replaced
3567:3bab1fc0ab75 3568:23f7d9621783
500 500
501 appliedbase = 0 501 appliedbase = 0
502 if opts.get('rev'): 502 if opts.get('rev'):
503 if not self.applied: 503 if not self.applied:
504 raise util.Abort(_('no patches applied')) 504 raise util.Abort(_('no patches applied'))
505 revs = [int(r) for r in cmdutil.revrange(ui, repo, opts['rev'])] 505 revs = cmdutil.revrange(ui, repo, opts['rev'])
506 if len(revs) > 1 and revs[0] > revs[1]: 506 if len(revs) > 1 and revs[0] > revs[1]:
507 revs.reverse() 507 revs.reverse()
508 for rev in revs: 508 for rev in revs:
509 if appliedbase >= len(self.applied): 509 if appliedbase >= len(self.applied):
510 raise util.Abort(_("revision %d is not managed") % rev) 510 raise util.Abort(_("revision %d is not managed") % rev)
1013 continue 1013 continue
1014 elif x in mm: 1014 elif x in mm:
1015 del mm[mm.index(x)] 1015 del mm[mm.index(x)]
1016 dd.append(x) 1016 dd.append(x)
1017 1017
1018 m = list(util.unique(mm)) 1018 m = util.unique(mm)
1019 r = list(util.unique(dd)) 1019 r = util.unique(dd)
1020 a = list(util.unique(aa)) 1020 a = util.unique(aa)
1021 filelist = filter(matchfn, util.unique(m + r + a)) 1021 filelist = filter(matchfn, util.unique(m + r + a))
1022 if opts.get('git'): 1022 if opts.get('git'):
1023 self.diffopts().git = True 1023 self.diffopts().git = True
1024 patch.diff(repo, patchparent, files=filelist, match=matchfn, 1024 patch.diff(repo, patchparent, files=filelist, match=matchfn,
1025 fp=patchf, changes=(m, a, r, [], u), 1025 fp=patchf, changes=(m, a, r, [], u),
1274 1274
1275 if rev: 1275 if rev:
1276 if files: 1276 if files:
1277 raise util.Abort(_('option "-r" not valid when importing ' 1277 raise util.Abort(_('option "-r" not valid when importing '
1278 'files')) 1278 'files'))
1279 rev = [int(r) for r in cmdutil.revrange(self.ui, repo, rev)] 1279 rev = cmdutil.revrange(self.ui, repo, rev)
1280 rev.sort(lambda x, y: cmp(y, x)) 1280 rev.sort(lambda x, y: cmp(y, x))
1281 if (len(files) > 1 or len(rev) > 1) and patchname: 1281 if (len(files) > 1 or len(rev) > 1) and patchname:
1282 raise util.Abort(_('option "-n" not valid when importing multiple ' 1282 raise util.Abort(_('option "-n" not valid when importing multiple '
1283 'patches')) 1283 'patches'))
1284 i = 0 1284 i = 0