@@ -7,6 +7,7 @@ set -e
#
# Options:
# -q Be quiet
+# -C Only check that the changeset exists in the remote repository
# -o FILE Generate archive in FILE.
# -u URI Clone from repository at URI.
# -c CSET Use changeset (or revision) CSET.
@@ -20,6 +21,7 @@ verbose=
while getopts "${BR_BACKEND_DL_GETOPTS}" OPT; do
case "${OPT}" in
q) verbose=-q;;
+ C) checkonly=1;;
o) output="${OPTARG}";;
u) uri="${OPTARG}";;
c) cset="${OPTARG}";;
@@ -37,6 +39,13 @@ _bzr() {
eval ${BZR} "${@}"
}
+if [ -n "${checkonly}" ]; then
+ # TODO this check only checks that the remote repository exists, not that
+ # it actually contains the requested revision.
+ _bzr ls --quiet "${@}" "'${uri}'" > /dev/null
+ exit ${?}
+fi
+
# --per-file-timestamps comes with bzr-2.2 (released August 2010),
# so only pass it if bzr is recent enough. We compute versions as:
# major*1000 + minor