How do I import a quilt patch series into hg/mq?

Paul Jackson pj at sgi.com
Thu Nov 24 08:18:57 UTC 2005


My primary use for 'quilt' is to apply Andrew Morton's *-mm
broken-out patch series on top of Linus's tree, before doing
a patch or two of my own, as more quilt patches.

My command series for that (from memory) is something like:

  hg clone <linus tree> <new-mm-tree>
  cd <new-mm-tree>
  hg log | more		# find <rev> on which *-mm is based
  hg co <rev>
  curl -O ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/.../*.bz2
  tar xvfj *.bz2
  mv broken-out patches
  quilt push -a

At this point, I am in business.

I tried doing something like the above using a copy of hg/mq that
I just pulled down, replacing the last couple lines with:

  mv broken-out .hg/patches
  hg qpush 	# intending to just push the first patch in *-mm series

and it bombed out, with the following crash.  I then removed all
but the first patch from .hg/patches and the .hg/patches/series file,
and tried again, and it worked with crashing.  Apparently the presence
of the other patches caused 'hg qpush' a problem.

How should I have done this?

The command and crash were:

    $ hg qpush
    applying linus.patch
    Traceback (most recent call last):
      File "/usr/people/pj/bin/hg", line 13, in ?
	commands.run()
      File "/usr/people/pj/lib/python/mercurial/commands.py", line 2412, in run
	sys.exit(dispatch(sys.argv[1:]))
      File "/usr/people/pj/lib/python/mercurial/commands.py", line 2580, in dispatch
	return d()
      File "/usr/people/pj/lib/python/mercurial/commands.py", line 2565, in <lambda>
	d = lambda: func(u, repo, *args, **cmdoptions)
      File "/usr/people/pj/lib/python/hgext/mq.py", line 973, in push
	mergeq=mergeq)
      File "/usr/people/pj/lib/python/hgext/mq.py", line 471, in push
	ret = self.apply(repo, s, list)
      File "/usr/people/pj/lib/python/hgext/mq.py", line 253, in apply
	commands.addremove(self.ui, repo, *files)
      File "/usr/people/pj/lib/python/mercurial/commands.py", line 509, in addremove
	for src, abs, rel, exact in walk(repo, pats, opts):
      File "/usr/people/pj/lib/python/mercurial/commands.py", line 51, in walk
	for r in results:
      File "/usr/people/pj/lib/python/mercurial/commands.py", line 45, in walk
	for src, fn in repo.walk(files=files, match=matchfn):
      File "/usr/people/pj/lib/python/mercurial/localrepo.py", line 476, in walk
	for src, fn in self.dirstate.walk(files, match):
      File "/usr/people/pj/lib/python/mercurial/dirstate.py", line 281, in walk
	for src, f, st in self.statwalk(files, match, dc):
      File "/usr/people/pj/lib/python/mercurial/dirstate.py", line 269, in statwalk
	dc = self.filterfiles(files)
      File "/usr/people/pj/lib/python/mercurial/dirstate.py", line 232, in filterfiles
	if bs != 0 and  b[bs-1] == x:
    TypeError: unsupported operand type(s) for -: 'instance' and 'int'              

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj at sgi.com> 1.925.600.0401



More information about the Mercurial mailing list