##// END OF EJS Templates
rebase: restrict rebase destination to the pulled set (issue5214)...
rebase: restrict rebase destination to the pulled set (issue5214) Before this patch, `hg pull --rebase` would be a strict sequence of `hg pull` followed by `hg rebase` if anything was pulled. Now that rebase pick his default destination the same way than merge, than `hg rebase` step would abort in the case the repo already had multiple anonymous heads (because of the ambiguity). (changed in fac3a24be50e) The intend of the user with `hg pull --rebase` is clearly to rebase on pulled content. This used to be (mostly) enforced by the former default destination for rebase, "tipmost changeset of the branch" as the tipmost would likely a changeset that just got pulled. But this intended was no longer enforced with the new defaul destination (unified with merge). This changeset makes use of the '_destspace' mechanism introduced in the previous changeset to enforce this. This partially fixes issue5214 as no change at all have been made to the new handling of the case with bookmark (unified with merge).

File last commit:

r28994:8797f03d stable
r29044:261c2537 stable
Show More
builddeb
101 lines | 2.2 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
debver="$debver+$distance-$node"
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
chmod -R 0755 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