Bug 524593 - nanojit-central to tracemonkey import machinery, r=gal.

This commit is contained in:
Graydon Hoare 2009-10-28 11:35:48 -07:00
Родитель 26a8e5a8ea
Коммит 649bb10406
4 изменённых файлов: 107 добавлений и 1 удалений

Просмотреть файл

@ -671,7 +671,34 @@ libs:: imacro_asm.js $(srcdir)/imacros.jsasm
update-imacros: imacros.c.tmp
cp $< $(srcdir)/imacros.c.out
.PHONY: update-imacros
# Code for importing the nanojit subtree from its repository.
NANOJIT_CENTRAL_REV=$(shell cat $(srcdir)/nanojit-import-rev)
NANOJIT_CENTRAL_REPO=http://hg.mozilla.org/users/graydon_mozilla.com/nanojit-central
NANOJIT_CENTRAL_LOCAL=$(CURDIR)/nanojit-central
CUR_REPO=$(srcdir)/../..
update-nanojit:
rm -Rf $(NANOJIT_CENTRAL_LOCAL) import-splicemap import-revmap
hg clone $(NANOJIT_CENTRAL_REPO) $(NANOJIT_CENTRAL_LOCAL)
python $(srcdir)/find-child.py \
--src=$(NANOJIT_CENTRAL_LOCAL) \
--dst=$(CUR_REPO) \
--start=$(NANOJIT_CENTRAL_REV) \
--filemap=$(srcdir)/nanojit-import-filemap \
>import-splicemap
hg convert --config convert.hg.saverev=True \
--config convert.hg.startrev=`cut -d ' ' -f 1 import-splicemap` \
--filemap=$(srcdir)/nanojit-import-filemap \
--splicemap=import-splicemap \
$(NANOJIT_CENTRAL_LOCAL) \
$(CUR_REPO) \
import-revmap
(cd $(srcdir) && hg up)
(cd $(NANOJIT_CENTRAL_LOCAL) && hg log -r tip --template "{node}\n") >$(srcdir)/nanojit-import-rev
(cd $(srcdir) && hg commit --message="Update nanojit-import-rev stamp." nanojit-import-rev)
.PHONY: update-imacros update-nanojit
endif
endif
endif

65
js/src/find-child.py Normal file
Просмотреть файл

@ -0,0 +1,65 @@
#!/usr/bin/python
#
# The output of this script is a splicemap.
#
# A splicemap is used by the mercurial 'convert' extension to direct its
# splicing operation.
#
# The script assumes you already have a destination repository
# containing a conversion somewhere in its history, but that you've
# possibly mixed some new commits on top of that conversion. It outputs
# a splicemap that picks up the conversion where it left off (with the
# first descendant, in the source repo, of the src rev given by --start,
# if or rather the first descendant that would be included by the
# conversion's filemap) and connects them to the current tip of the
# destination repo.
#
from mercurial import ui, hg
from hgext.convert.filemap import filemapper
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-s", "--src", dest="src",
help="source repository", metavar="REPO")
parser.add_option("-d", "--dst", dest="dst",
help="destination repository", metavar="REPO")
parser.add_option("-t", "--start", dest="start",
help="starting revid in source repository", metavar="REV")
parser.add_option("-f", "--filemap", dest="filemap",
help="filemap used in conversion", metavar="PATH")
(options, args) = parser.parse_args()
if not (options.src and options.dst and options.start):
parser.print_help()
exit(1)
u = ui.ui()
src_repo = hg.repository(u, options.src)
dst_repo = hg.repository(u, options.dst)
fm = None
if options.filemap:
fm = filemapper(u, options.filemap)
last_converted_src = src_repo[options.start]
dst_tip = dst_repo.changectx(dst_repo.changelog.tip()).hex()
revs = last_converted_src.children()
while len(revs) != 0:
tmp = revs
revs = []
for child in tmp:
for f in child.files():
if (not fm) or fm(f):
u.write("%s %s\n" % (child.hex(), dst_tip))
exit(0);
revs.extend(child.children())

Просмотреть файл

@ -0,0 +1,13 @@
include nanojit
include vprof
include lirasm
exclude Makefile.in
exclude configure.in
exclude config.h.in
exclude autoconf
exclude .hgtags
rename vprof js/src/vprof
rename nanojit js/src/nanojit
rename lirasm js/src/lirasm

Просмотреть файл

@ -0,0 +1 @@
10b3df8a462806dcf7e534b278362f2ecd13e50f