fncachestore: copy dh directory before the manifest
Before this patch, the copy order on clone was:
requires
00changelog.i
store\data
store\00manifest.d
store\00manifest.i
store\00changelog.d
store\00changelog.i
store\dh
store\fncache
Which provides a theoretical non-zero probability of a race during clone where
a very early reader might see a repository with missing revlog files if it sees
00changelog.i before all files inside dh have been copied.
The dh directory is similar to the data directory -- just for files with long
names (which are hashed). The manifest refers to files in data *and* dh, so dh
should be copied before the manifest.
This patch improves the copy order to:
requires
00changelog.i
store\data
store\dh
store\fncache
store\00manifest.d
store\00manifest.i
store\00changelog.d
store\00changelog.i
I'm putting fncache to before the manifest while I'm at it, since fncache
provides a mechanism to enumerate all repository files without visiting the
manifest revisions. fncache depends only on data and dh.
Note that data must be copied first, since copying data triggers the creation
of the repository write lock in the destination repo (see hg.clone).
SOURCES=$(wildcard *.[0-9].txt)
MAN=$(SOURCES:%.txt=%)
HTML=$(SOURCES:%.txt=%.html)
GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py ../mercurial/help/*.txt
PREFIX=/usr/local
MANDIR=$(PREFIX)/share/man
INSTALL=install -c -m 644
PYTHON=python
export LANGUAGE=C
export LC_ALL=C
all: man html
man: $(MAN)
html: $(HTML)
hg.1.txt: hg.1.gendoc.txt
touch hg.1.txt
hg.1.gendoc.txt: $(GENDOC)
${PYTHON} gendoc.py > $@.tmp
mv $@.tmp $@
%: %.txt common.txt
$(PYTHON) runrst hgmanpage --halt warning \
--strip-elements-with-class htmlonly $*.txt $*
%.html: %.txt common.txt
$(PYTHON) runrst html --halt warning \
--link-stylesheet --stylesheet-path style.css $*.txt $*.html
MANIFEST: man html
# tracked files are already in the main MANIFEST
$(RM) $@
for i in $(MAN) $(HTML); do \
echo "doc/$$i" >> $@ ; \
done
install: man
for i in $(MAN) ; do \
subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \
mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \
$(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \
done
clean:
$(RM) $(MAN) $(HTML) hg.1.gendoc.txt MANIFEST