##// END OF EJS Templates
revlog: skeleton support for version 2 revlogs...
revlog: skeleton support for version 2 revlogs There are a number of improvements we want to make to revlogs that will require a new version - version 2. It is unclear what the full set of improvements will be or when we'll be done with them. What I do know is that the process will likely take longer than a single release, will require input from various stakeholders to evaluate changes, and will have many contentious debates and bikeshedding. It is unrealistic to develop revlog version 2 up front: there are just too many uncertainties that we won't know until things are implemented and experiments are run. Some changes will also be invasive and prone to bit rot, so sitting on dozens of patches is not practical. This commit introduces skeleton support for version 2 revlogs in a way that is flexible and not bound by backwards compatibility concerns. An experimental repo requirement for denoting revlog v2 has been added. The requirement string has a sub-version component to it. This will allow us to declare multiple requirements in the course of developing revlog v2. Whenever we change the in-development revlog v2 format, we can tweak the string, creating a new requirement and locking out old clients. This will allow us to make as many backwards incompatible changes and experiments to revlog v2 as we want. In other words, we can land code and make meaningful progress towards revlog v2 while still maintaining extreme format flexibility up until the point we freeze the format and remove the experimental labels. To enable the new repo requirement, you must supply an experimental and undocumented config option. But not just any boolean flag will do: you need to explicitly use a value that no sane person should ever type. This is an additional guard against enabling revlog v2 on an installation it shouldn't be enabled on. The specific scenario I'm trying to prevent is say a user with a 4.4 client with a frozen format enabling the option but then downgrading to 4.3 and accidentally creating repos with an outdated and unsupported repo format. Requiring a "challenge" string should prevent this. Because the format is not yet finalized and I don't want to take any chances, revlog v2's version is currently 0xDEAD. I figure squatting on a value we're likely never to use as an actual revlog version to mean "internal testing only" is acceptable. And "dead" is easily recognized as something meaningful. There is a bunch of cleanup that is needed before work on revlog v2 begins in earnest. I plan on doing that work once this patch is accepted and we're comfortable with the idea of starting down this path.

File last commit:

r29093:c4f0e764 stable
r32697:19b9fc40 default
Show More
builddeb
104 lines | 2.4 KiB | text/plain | TextLexer
Augie Fackler
builddeb: new script for building a deb package...
r24971 #!/bin/sh -e
#
# Build a Mercurial debian package from the current repo
#
# Tested on Jessie (stable as of original script authoring.)
Augie Fackler
packaging: extract packagelib for common code from builddeb and buildrpm
r24972 . $(dirname $0)/packagelib.sh
Augie Fackler
builddeb: new script for building a deb package...
r24971 BUILD=1
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 CLEANUP=1
av6
builddeb: read default distribution and codename from lsb_release...
r27212 DISTID=`(lsb_release -is 2> /dev/null | tr '[:upper:]' '[:lower:]') || echo debian`
CODENAME=`lsb_release -cs 2> /dev/null || echo unknown`
Sean Farley
builddeb: add flag for a source-only deb...
r28994 DEBFLAGS=-b
Augie Fackler
builddeb: new script for building a deb package...
r24971 while [ "$1" ]; do
case "$1" in
av6
builddeb: add --distid option to specify Distributor ID...
r27210 --distid )
shift
DISTID="$1"
shift
;;
av6
builddeb: rename --release option to --codename...
r27209 --codename )
Augie Fackler
builddeb: rework how output dir and platform are specified...
r26108 shift
av6
builddeb: rename --release option to --codename...
r27209 CODENAME="$1"
Augie Fackler
builddeb: rework how output dir and platform are specified...
r26108 shift
;;
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 --cleanup )
Augie Fackler
builddeb: new script for building a deb package...
r24971 shift
BUILD=
;;
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 --build )
shift
CLEANUP=
;;
Sean Farley
builddeb: add flag for a source-only deb...
r28994 --source-only )
shift
DEBFLAGS=-S
;;
Augie Fackler
builddeb: new script for building a deb package...
r24971 * )
echo "Invalid parameter $1!" 1>&2
exit 1
;;
esac
done
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 trap "if [ '$CLEANUP' ] ; then rm -r '$PWD/debian' ; fi" EXIT
Augie Fackler
builddeb: rework how output dir and platform are specified...
r26108
Augie Fackler
builddeb: new script for building a deb package...
r24971 set -u
if [ ! -d .hg ]; then
echo 'You are not inside a Mercurial repository!' 1>&2
exit 1
fi
Augie Fackler
packaging: extract packagelib for common code from builddeb and buildrpm
r24972 gethgversion
Augie Fackler
packaging: rework version detection and declaration (issue4912)...
r26833 debver="$version"
if [ -n "$type" ] ; then
debver="$debver~$type"
fi
if [ -n "$distance" ] ; then
Sean Farley
builddeb: use codename in version...
r29045 debver="$debver+$distance-$CODENAME-$node"
Sean Farley
builddeb: add distroseries to tagged versions...
r29093 elif [ "$DEBFLAGS" = "-S" ] ; then
# for building a ppa (--source-only) for a release (distance == 0), we need
# to version the distroseries so that we can upload to launchpad
debver="$debver~${CODENAME}1"
Augie Fackler
packaging: rework version detection and declaration (issue4912)...
r26833 fi
Augie Fackler
builddeb: new script for building a deb package...
r24971
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 control=debian/control
changelog=debian/changelog
Augie Fackler
builddeb: new script for building a deb package...
r24971
if [ "$BUILD" ]; then
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 if [ -d debian ] ; then
echo "Error! debian control directory already exists!"
exit 1
Augie Fackler
builddeb: new script for building a deb package...
r24971 fi
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148
cp -r $PWD/contrib/debian debian
Sean Farley
builddeb: use sed -i...
r28988 sed -i.tmp "s/__VERSION__/$debver/" $changelog
sed -i.tmp "s/__DATE__/$(date --rfc-2822)/" $changelog
Sean Farley
builddeb: use the os codename instead of 'unstable'...
r28989 sed -i.tmp "s/__CODENAME__/$CODENAME/" $changelog
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 rm $changelog.tmp
Sean Farley
builddeb: create source archive for ubuntu
r28993 # remove the node from the version string
SRCFILE="mercurial_$(echo $debver | sed "s,-$node,,").orig.tar.gz"
"$PWD/hg" archive $SRCFILE
mv $SRCFILE ..
Sean Farley
builddeb: add flag for a source-only deb...
r28994 debuild -us -uc -i -I $DEBFLAGS
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 if [ $? != 0 ]; then
echo 'debuild failed!'
exit 1
fi
Augie Fackler
builddeb: new script for building a deb package...
r24971 fi
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 if [ "$CLEANUP" ] ; then
echo
av6
builddeb: add --distid option to specify Distributor ID...
r27210 OUTPUTDIR=${OUTPUTDIR:=packages/$DISTID-$CODENAME}
av6
builddeb: read default distribution and codename from lsb_release...
r27212 mkdir -p "$OUTPUTDIR"
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
Sean Farley
builddeb: copy over .gz and .dsc files...
r28991 ../mercurial*.dsc ../mercurial*.gz \
Sean Farley
builddeb: ignore errors about find not finding files...
r28990 -type f -newer $control -print0 2>/dev/null | \
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 xargs -Inarf -0 mv narf "$OUTPUTDIR"
Augie Fackler
packaging: rework version detection and declaration (issue4912)...
r26833 echo "Built packages for $debver:"
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
fi