equal
deleted
inserted
replaced
31 |
31 |
32 from mercurial.demandload import * |
32 from mercurial.demandload import * |
33 from mercurial.i18n import gettext as _ |
33 from mercurial.i18n import gettext as _ |
34 from mercurial import commands |
34 from mercurial import commands |
35 demandload(globals(), "os sys re struct traceback errno bz2") |
35 demandload(globals(), "os sys re struct traceback errno bz2") |
36 demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,ui,util") |
36 demandload(globals(), "mercurial:cmdutil,hg,patch,revlog,util") |
37 |
37 |
38 commands.norepo += " qclone qversion" |
38 commands.norepo += " qclone qversion" |
39 |
39 |
40 class statusentry: |
40 class statusentry: |
41 def __init__(self, rev, name=None): |
41 def __init__(self, rev, name=None): |
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 = cmdutil.revrange(ui, repo, opts['rev']) |
505 revs = cmdutil.revrange(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) |
1313 |
1313 |
1314 if rev: |
1314 if rev: |
1315 if files: |
1315 if files: |
1316 raise util.Abort(_('option "-r" not valid when importing ' |
1316 raise util.Abort(_('option "-r" not valid when importing ' |
1317 'files')) |
1317 'files')) |
1318 rev = cmdutil.revrange(self.ui, repo, rev) |
1318 rev = cmdutil.revrange(repo, rev) |
1319 rev.sort(lambda x, y: cmp(y, x)) |
1319 rev.sort(lambda x, y: cmp(y, x)) |
1320 if (len(files) > 1 or len(rev) > 1) and patchname: |
1320 if (len(files) > 1 or len(rev) > 1) and patchname: |
1321 raise util.Abort(_('option "-n" not valid when importing multiple ' |
1321 raise util.Abort(_('option "-n" not valid when importing multiple ' |
1322 'patches')) |
1322 'patches')) |
1323 i = 0 |
1323 i = 0 |