aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 23:42:28 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 23:52:27 +0000
commit8b04af73bee62cb97de96f2e79dc5835e0ac3a4c (patch)
tree70ff8b7aecdd1a00c49567b41d1f9d6c8d0d52b0
parente19d5e245fd7e0dfcfd97cc1f31151f59cadec31 (diff)
downloadpaludis-8b04af73bee62cb97de96f2e79dc5835e0ac3a4c.tar.gz
paludis-8b04af73bee62cb97de96f2e79dc5835e0ac3a4c.tar.xz
Let syncing specify a revision
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc1
-rw-r--r--paludis/repositories/accounts/accounts_repository.hh6
-rw-r--r--paludis/repositories/e/e_installed_repository.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository.hh1
-rw-r--r--paludis/repositories/e/e_repository.cc5
-rw-r--r--paludis/repositories/e/e_repository.hh5
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc1
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh2
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.cc2
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.hh2
-rw-r--r--paludis/repositories/repository/repository_repository.cc4
-rw-r--r--paludis/repositories/repository/repository_repository.hh2
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc5
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.hh2
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc1
-rw-r--r--paludis/repositories/unpackaged/installed_repository.hh2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.hh2
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc5
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.hh2
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc1
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh2
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc1
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh2
-rw-r--r--paludis/repository.hh4
-rw-r--r--paludis/syncer.cc9
-rw-r--r--paludis/syncer.hh14
-rw-r--r--paludis/syncers/dobzr.in4
-rw-r--r--paludis/syncers/docvs.in5
-rw-r--r--paludis/syncers/dodarcs.in5
-rw-r--r--paludis/syncers/dogit.in12
-rw-r--r--paludis/syncers/dohg.in5
-rw-r--r--paludis/syncers/dorsync.in5
-rw-r--r--paludis/syncers/dosvn.in5
-rw-r--r--paludis/syncers/dotar.in5
-rw-r--r--src/clients/cave/cmd_sync.cc2
36 files changed, 107 insertions, 27 deletions
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 8b30942..5400bac 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -449,6 +449,7 @@ AccountsRepository::perform_hook(
bool
AccountsRepository::sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const
{
return false;
diff --git a/paludis/repositories/accounts/accounts_repository.hh b/paludis/repositories/accounts/accounts_repository.hh
index 0c6cc09..9234ab1 100644
--- a/paludis/repositories/accounts/accounts_repository.hh
+++ b/paludis/repositories/accounts/accounts_repository.hh
@@ -143,7 +143,11 @@ namespace paludis
virtual HookResult perform_hook(
const Hook & hook,
const std::shared_ptr<OutputManager> &);
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+
+ virtual bool sync(
+ const std::string &,
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const;
///\}
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 06aebc6..2c670d1 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -398,7 +398,7 @@ EInstalledRepository::populate_sets() const
}
bool
-EInstalledRepository::sync(const std::string &, const std::shared_ptr<OutputManager> &) const
+EInstalledRepository::sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const
{
return false;
}
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 3d076d7..9aa1825 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -90,6 +90,7 @@ namespace paludis
virtual bool sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const;
///\name For use by EInstalledRepositoryID
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index b5d502d..e233508 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -697,6 +697,7 @@ ERepository::need_mirrors() const
bool
ERepository::sync(
const std::string & suffix,
+ const std::string & revision,
const std::shared_ptr<OutputManager> & output_manager) const
{
Context context("When syncing repository '" + stringify(name()) + "':");
@@ -720,8 +721,10 @@ ERepository::sync(
DefaultSyncer syncer(make_named_values<SyncerParams>(
n::environment() = _imp->params.environment(),
n::local() = stringify(_imp->params.location()),
- n::remote() = *s
+ n::remote() = *s,
+ n::revision() = revision
));
+
SyncOptions opts(make_named_values<SyncOptions>(
n::filter_file() = _imp->layout->sync_filter_file(),
n::options() = sync_options,
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index e800f84..3fc9c5e 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -105,7 +105,10 @@ namespace paludis
/* RepositorySyncableInterface */
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(
+ const std::string &,
+ const std::string &,
+ const std::shared_ptr<OutputManager> &) const;
/* RepositoryEnvironmentVariableInterface */
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index a45a825..1c5e24e 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -200,6 +200,7 @@ FakeRepositoryBase::perform_hook(const Hook &, const std::shared_ptr<OutputManag
bool
FakeRepositoryBase::sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const
{
return false;
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index a97b848..f1b0567 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -114,7 +114,7 @@ namespace paludis
virtual bool has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
///\name Set methods
///\{
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.cc b/paludis/repositories/gemcutter/gemcutter_repository.cc
index 563e6cd..b03a21b 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.cc
+++ b/paludis/repositories/gemcutter/gemcutter_repository.cc
@@ -247,7 +247,7 @@ GemcutterRepository::some_ids_might_not_be_masked() const
}
bool
-GemcutterRepository::sync(const std::string &, const std::shared_ptr<OutputManager> &) const
+GemcutterRepository::sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const
{
return false;
}
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.hh b/paludis/repositories/gemcutter/gemcutter_repository.hh
index ea08595..428d0a6 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.hh
+++ b/paludis/repositories/gemcutter/gemcutter_repository.hh
@@ -89,7 +89,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
virtual void invalidate();
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 8718a4b..0da3736 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -259,7 +259,7 @@ RepositoryRepository::some_ids_might_not_be_masked() const
}
bool
-RepositoryRepository::sync(const std::string &, const std::shared_ptr<OutputManager> &) const
+RepositoryRepository::sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const
{
return false;
}
@@ -477,7 +477,7 @@ RepositoryRepository::merge(const MergeParams & m)
}
m.output_manager()->stdout_stream() << "Syncing..." << std::endl;
- _imp->params.environment()->repository_from_new_config_file(config_filename_file)->sync("", m.output_manager());
+ _imp->params.environment()->repository_from_new_config_file(config_filename_file)->sync("", "", m.output_manager());
/* the repo we'd get before syncing is mostly unusable */
const std::shared_ptr<Repository> newly_created_repo(
diff --git a/paludis/repositories/repository/repository_repository.hh b/paludis/repositories/repository/repository_repository.hh
index 006ad7b..6046078 100644
--- a/paludis/repositories/repository/repository_repository.hh
+++ b/paludis/repositories/repository/repository_repository.hh
@@ -95,7 +95,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
virtual void invalidate();
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
virtual bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 428b77d..4739c72 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -316,6 +316,7 @@ UnavailableRepository::some_ids_might_not_be_masked() const
bool
UnavailableRepository::sync(
const std::string & suffix,
+ const std::string & revision,
const std::shared_ptr<OutputManager> & output_manager) const
{
Context context("When syncing repository '" + stringify(name()) + "':");
@@ -339,8 +340,10 @@ UnavailableRepository::sync(
DefaultSyncer syncer(make_named_values<SyncerParams>(
n::environment() = _imp->params.environment(),
n::local() = stringify(_imp->params.location()),
- n::remote() = *s
+ n::remote() = *s,
+ n::revision() = revision
));
+
SyncOptions opts(make_named_values<SyncOptions>(
n::filter_file() = FSPath("/dev/null"),
n::options() = sync_options,
diff --git a/paludis/repositories/unavailable/unavailable_repository.hh b/paludis/repositories/unavailable/unavailable_repository.hh
index fdab7db..3d5fdd5 100644
--- a/paludis/repositories/unavailable/unavailable_repository.hh
+++ b/paludis/repositories/unavailable/unavailable_repository.hh
@@ -94,7 +94,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
virtual void invalidate();
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 7d064f1..14cc032 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -509,6 +509,7 @@ InstalledUnpackagedRepository::perform_hook(const Hook &, const std::shared_ptr<
bool
InstalledUnpackagedRepository::sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const
{
return false;
diff --git a/paludis/repositories/unpackaged/installed_repository.hh b/paludis/repositories/unpackaged/installed_repository.hh
index d364fa2..ba025db 100644
--- a/paludis/repositories/unpackaged/installed_repository.hh
+++ b/paludis/repositories/unpackaged/installed_repository.hh
@@ -140,7 +140,7 @@ namespace paludis
virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
};
}
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 6474c26..dc78884 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -303,6 +303,7 @@ UnpackagedRepository::perform_hook(const Hook &, const std::shared_ptr<OutputMan
bool
UnpackagedRepository::sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const
{
return false;
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.hh b/paludis/repositories/unpackaged/unpackaged_repository.hh
index c3129c4..4310965 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.hh
+++ b/paludis/repositories/unpackaged/unpackaged_repository.hh
@@ -108,7 +108,7 @@ namespace paludis
virtual const bool is_unimportant() const;
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
/* Keys */
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 9bf0aa6..c23cd84 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -264,6 +264,7 @@ UnwrittenRepository::some_ids_might_not_be_masked() const
bool
UnwrittenRepository::sync(
const std::string & suffix,
+ const std::string & revision,
const std::shared_ptr<OutputManager> & output_manager) const
{
Context context("When syncing repository '" + stringify(name()) + "':");
@@ -287,8 +288,10 @@ UnwrittenRepository::sync(
DefaultSyncer syncer(make_named_values<SyncerParams>(
n::environment() = _imp->params.environment(),
n::local() = stringify(_imp->params.location()),
- n::remote() = *s
+ n::remote() = *s,
+ n::revision() = revision
));
+
SyncOptions opts(make_named_values<SyncOptions>(
n::filter_file() = FSPath("/dev/null"),
n::options() = sync_options,
diff --git a/paludis/repositories/unwritten/unwritten_repository.hh b/paludis/repositories/unwritten/unwritten_repository.hh
index 7abde04..5c29395 100644
--- a/paludis/repositories/unwritten/unwritten_repository.hh
+++ b/paludis/repositories/unwritten/unwritten_repository.hh
@@ -93,7 +93,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
virtual void invalidate();
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> & output_manager) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> & output_manager) const;
///\name RepositoryFactory functions
///\{
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 413b8bf..ff4ec82 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -391,6 +391,7 @@ InstalledVirtualsRepository::populate_sets() const
bool
InstalledVirtualsRepository::sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const
{
return false;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
index 037232d..c78d813 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.hh
@@ -108,7 +108,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
/* Keys */
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 86dec79..ca1e9aa 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -462,6 +462,7 @@ VirtualsRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManag
bool
VirtualsRepository::sync(
const std::string &,
+ const std::string &,
const std::shared_ptr<OutputManager> &) const
{
return false;
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index c83a299..430cd82 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -106,7 +106,7 @@ namespace paludis
virtual bool some_ids_might_not_be_masked() const;
- virtual bool sync(const std::string &, const std::shared_ptr<OutputManager> &) const;
+ virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
/* RepositoryMakeVirtualsInterface */
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 66f0c80..1d6b64d 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -460,10 +460,12 @@ namespace paludis
*
* \return True if we synced successfully, false if we skipped sync.
* \since 0.42 (previously in an interface)
- * \since 0.55 takes a suffix
+ * \since 0.55 takes a suffix (may be empty)
+ * \since 0.61 takes a revision (may be empty)
*/
virtual bool sync(
const std::string & suffix,
+ const std::string & revision,
const std::shared_ptr<OutputManager> &) const = 0;
/**
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index 682d429..9a6a26e 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006 Stephen Klimaszewski
* Copyright (c) 2007 David Leverton
*
@@ -52,6 +52,7 @@ SyncFailedError::SyncFailedError(const std::string & msg) throw () :
DefaultSyncer::DefaultSyncer(const SyncerParams & params) :
_local(params.local()),
_remote(params.remote()),
+ _revision(params.revision()),
_environment(params.environment())
{
std::string::size_type p(_remote.find("://")), q(_remote.find(":"));
@@ -93,7 +94,11 @@ DefaultSyncer::sync(const SyncOptions & opts) const
std::shared_ptr<const FSPathSequence> fetchers_dirs(_environment->fetchers_dirs());
std::shared_ptr<const FSPathSequence> syncers_dirs(_environment->syncers_dirs());
- Process process(ProcessCommand(stringify(_syncer) + " " + opts.options() + " '" + _local + "' '" + _remote + "'"));
+ std::string revision;
+ if (! _revision.empty())
+ revision = " --revision='" + _revision + "'";
+
+ Process process(ProcessCommand(stringify(_syncer) + " " + opts.options() + revision + " '" + _local + "' '" + _remote + "'"));
process
.setenv("PALUDIS_ACTION", "sync")
diff --git a/paludis/syncer.hh b/paludis/syncer.hh
index d06e8e4..bb12cfa 100644
--- a/paludis/syncer.hh
+++ b/paludis/syncer.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -46,6 +46,7 @@ namespace paludis
typedef Name<struct name_options> options;
typedef Name<struct name_output_manager> output_manager;
typedef Name<struct name_remote> remote;
+ typedef Name<struct name_revision> revision;
}
/**
@@ -75,8 +76,17 @@ namespace paludis
struct SyncerParams
{
NamedValue<n::environment, const Environment *> environment;
+
NamedValue<n::local, std::string> local;
+
NamedValue<n::remote, std::string> remote;
+
+ /**
+ * Usually empty, and not supported by most syncers.
+ *
+ * \since 0.61
+ */
+ NamedValue<n::revision, std::string> revision;
};
/**
@@ -116,7 +126,7 @@ namespace paludis
public Syncer
{
private:
- std::string _local, _remote;
+ std::string _local, _remote, _revision;
const Environment *_environment;
std::string _syncer;
diff --git a/paludis/syncers/dobzr.in b/paludis/syncers/dobzr.in
index 1337c42..d44bfe7 100644
--- a/paludis/syncers/dobzr.in
+++ b/paludis/syncers/dobzr.in
@@ -52,6 +52,10 @@ while [[ $# -gt 0 ]]; do
echo " --bzr-switch-option=OPTION Pass OPTION to bzr switch"
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
--*)
ewarn "${0}: unknown option '${1%%=*}'"
diff --git a/paludis/syncers/docvs.in b/paludis/syncers/docvs.in
index f4daa69..3a5e78b 100644
--- a/paludis/syncers/docvs.in
+++ b/paludis/syncers/docvs.in
@@ -43,6 +43,11 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
+
--*)
ewarn "${0}: unknown option '${1%%=*}'"
;;
diff --git a/paludis/syncers/dodarcs.in b/paludis/syncers/dodarcs.in
index 6907c5b..96d1529 100644
--- a/paludis/syncers/dodarcs.in
+++ b/paludis/syncers/dodarcs.in
@@ -53,6 +53,11 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
+
--*)
ewarn "${0}: unknown option '${1%%=*}'"
;;
diff --git a/paludis/syncers/dogit.in b/paludis/syncers/dogit.in
index 13a3136..71ee461 100644
--- a/paludis/syncers/dogit.in
+++ b/paludis/syncers/dogit.in
@@ -20,6 +20,7 @@ GIT_PULL_OPTIONS=( )
GIT_FETCH_OPTIONS=( )
GIT_BRANCH=
+GIT_REVISION=
GIT_USE_RESET=true
while [[ $# -gt 0 ]]; do
@@ -41,6 +42,10 @@ while [[ $# -gt 0 ]]; do
GIT_BRANCH="${1#*=}"
;;
+ --revision=*)
+ GIT_REVISION="${1#*=}"
+ ;;
+
--reset)
ewarn "--reset is now the default for git syncers. It should no longer be specified manually."
GIT_USE_RESET=true
@@ -68,6 +73,7 @@ while [[ $# -gt 0 ]]; do
echo " Options:"
echo " --branch=BRANCH Specify the branch to use"
+ echo " --revision=REVISION Specify the revision to use"
echo " --git-clone-option=OPTION Pass OPTION to git clone"
echo " --git-pull-option=OPTION Pass OPTION to git pull (if --no-reset)"
echo " --git-fetch-option=OPTION Pass OPTION to git fetch (unless --no-reset)"
@@ -129,13 +135,13 @@ if [[ -d "${LOCAL}/.git" ]]; then
if ${GIT_USE_RESET} ; then
cd "${LOCAL}"
${GIT_WRAPPER} git fetch "${GIT_FETCH_OPTIONS[@]}" origin || exit $?
- ${GIT_WRAPPER} git reset --hard origin/${GIT_BRANCH:-master} || exit $?
+ ${GIT_WRAPPER} git reset --hard ${GIT_REVISION:-origin/${GIT_BRANCH:-master}} || exit $?
else
cd "${LOCAL}"
- ${GIT_WRAPPER} git pull "${GIT_PULL_OPTIONS[@]}" origin ${GIT_BRANCH} || exit $?
+ ${GIT_WRAPPER} git pull "${GIT_PULL_OPTIONS[@]}" origin ${GIT_REVISION:-${GIT_BRANCH}} || exit $?
fi
else
${GIT_WRAPPER} git clone "${GIT_CLONE_OPTIONS[@]}" "${REMOTE}" "${LOCAL}" || exit $?
- cd "${LOCAL}" && ${GIT_WRAPPER} git reset --hard origin${GIT_BRANCH:+/${GIT_BRANCH}} || exit $?
+ cd "${LOCAL}" && ${GIT_WRAPPER} git reset --hard ${GIT_REVISION:-origin${GIT_BRANCH:+/${GIT_BRANCH}}} || exit $?
fi
diff --git a/paludis/syncers/dohg.in b/paludis/syncers/dohg.in
index f002bd4..8366b55 100644
--- a/paludis/syncers/dohg.in
+++ b/paludis/syncers/dohg.in
@@ -61,6 +61,11 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
+
--*)
ewarn "${0}: unknown option '${1%%=*}'"
;;
diff --git a/paludis/syncers/dorsync.in b/paludis/syncers/dorsync.in
index 1be780a..0328ed5 100644
--- a/paludis/syncers/dorsync.in
+++ b/paludis/syncers/dorsync.in
@@ -53,6 +53,11 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
+
--*)
ewarn "${0}: unknown option '${1%%=*}'"
;;
diff --git a/paludis/syncers/dosvn.in b/paludis/syncers/dosvn.in
index 0381666..d642f93 100644
--- a/paludis/syncers/dosvn.in
+++ b/paludis/syncers/dosvn.in
@@ -42,6 +42,11 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
+
--*)
ewarn "${0}: unknown option '${1%%=*}'"
;;
diff --git a/paludis/syncers/dotar.in b/paludis/syncers/dotar.in
index 2436f41..e5f2464 100644
--- a/paludis/syncers/dotar.in
+++ b/paludis/syncers/dotar.in
@@ -85,6 +85,11 @@ while [[ $# -gt 0 ]]; do
exit 0
;;
+ --revision=*)
+ eerror "${0}: --revision unsupported"
+ exit 1
+ ;;
+
--*)
ewarn "${0}: unknown option '${1%%=*}'"
;;
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index b8f17b6..dd9b769 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -199,7 +199,7 @@ namespace
{
const std::shared_ptr<Repository> repo(env->package_database()->fetch_repository(name));
- if (! repo->sync(cmdline.a_suffix.argument(), output_manager))
+ if (! repo->sync(cmdline.a_suffix.argument(), "", output_manager))
skipped = true;
success = true;
}