summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2012-09-12 21:16:28 +0000
committerUlrich Müller <ulm@gentoo.org>2012-09-12 21:16:28 +0000
commitbe14d895650bf3cf6c2fca6135ac9b3cede32c4e (patch)
tree0249e0c7822f46d689678b2426ca3afd08f4fa4b /eclass/bzr.eclass
parentRemove cleanup code for old checkouts. (diff)
downloademacs-be14d895650bf3cf6c2fca6135ac9b3cede32c4e.tar.gz
emacs-be14d895650bf3cf6c2fca6135ac9b3cede32c4e.tar.bz2
emacs-be14d895650bf3cf6c2fca6135ac9b3cede32c4e.zip
Experimental code to use lightweight checkout instead of export.
This can be controlled with the EBZR_WORKDIR_CHECKOUT variable. See bug 434746. svn path=/emacs-overlay/; revision=1832
Diffstat (limited to 'eclass/bzr.eclass')
-rw-r--r--eclass/bzr.eclass28
1 files changed, 24 insertions, 4 deletions
diff --git a/eclass/bzr.eclass b/eclass/bzr.eclass
index af20aef..ecb135f 100644
--- a/eclass/bzr.eclass
+++ b/eclass/bzr.eclass
@@ -61,6 +61,11 @@ esac
# The Bazaar command to export a branch.
: ${EBZR_EXPORT_CMD:="bzr export"}
+# @ECLASS-VARIABLE: EBZR_CHECKOUT_CMD
+# @DESCRIPTION:
+# The Bazaar command to checkout a branch.
+: ${EBZR_CHECKOUT_CMD:="bzr checkout --lightweight"}
+
# @ECLASS-VARIABLE: EBZR_REVNO_CMD
# @DESCRIPTION:
# The Bazaar command to list a revision number of the branch.
@@ -145,6 +150,12 @@ esac
# by users.
: ${EBZR_OFFLINE=${EVCS_OFFLINE}}
+# @ECLASS-VARIABLE: EBZR_WORKDIR_CHECKOUT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# If this variable is set to a non-empty value, EBZR_CHECKOUT_CMD will
+# be used instead of EBZR_EXPORT_CMD to copy the sources to WORKDIR.
+
# @FUNCTION: bzr_initial_fetch
# @USAGE: <repository URI> <branch directory>
# @DESCRIPTION:
@@ -196,11 +207,11 @@ bzr_update() {
# working copy.
bzr_fetch() {
local repo_dir branch_dir
+ local save_sandbox_write=${SANDBOX_WRITE}
[[ -n ${EBZR_REPO_URI} ]] || die "${EBZR}: EBZR_REPO_URI is empty"
if [[ ! -d ${EBZR_STORE_DIR} ]] ; then
- local save_sandbox_write=${SANDBOX_WRITE}
addwrite /
mkdir -p "${EBZR_STORE_DIR}" \
|| die "${EBZR}: can't mkdir ${EBZR_STORE_DIR}"
@@ -239,14 +250,23 @@ bzr_fetch() {
bzr_update "${EBZR_REPO_URI}" "${branch_dir}"
fi
+ # Restore sandbox environment
+ SANDBOX_WRITE=${save_sandbox_write}
+
cd "${branch_dir}" || die "${EBZR}: can't chdir to ${branch_dir}"
# Save revision number in environment. #311101
export EBZR_REVNO=$(${EBZR_REVNO_CMD})
- einfo "exporting ..."
- ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
- "${WORKDIR}/${P}" . || die "${EBZR}: export failed"
+ if [[ -n ${EBZR_WORKDIR_CHECKOUT} ]]; then
+ einfo "checking out ..."
+ ${EBZR_CHECKOUT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
+ . "${WORKDIR}/${P}" || die "${EBZR}: checkout failed"
+ else
+ einfo "exporting ..."
+ ${EBZR_EXPORT_CMD} ${EBZR_REVISION:+-r ${EBZR_REVISION}} \
+ "${WORKDIR}/${P}" . || die "${EBZR}: export failed"
+ fi
einfo "revision ${EBZR_REVISION:-${EBZR_REVNO}} is now in ${WORKDIR}/${P}"
popd > /dev/null