]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Added --force option that disables repository skipping.
authorJoey Hess <joey@kitenet.net>
Mon, 12 Dec 2011 17:10:25 +0000 (13:10 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 12 Dec 2011 17:10:25 +0000 (13:10 -0400)
* Added --force option that disables repository skipping.
* Repositories using skip = lazy will not be checked out by "mr update"
  or "mr checkout" unless --force is used.

debian/changelog
mr

index 6548c923f1f94327714f3cd7d5f140423f815ffd..920b89d88b849c8542a18cc01b02530c271faac8 100644 (file)
@@ -10,6 +10,9 @@ mr (1.07) UNRELEASED; urgency=low
     (Thanks, Adam Spiers)
   * Optimizations.
   * Fix shell escaping of parameters passed to mr commands. Closes: #644672
+  * Added --force option that disables repository skipping.
+  * Repositories using skip = lazy will not be checked out by "mr update"
+    or "mr checkout" unless --force is used.
 
  -- Joey Hess <joeyh@debian.org>  Tue, 29 Nov 2011 18:15:51 -0400
 
diff --git a/mr b/mr
index 1923506a42cf4522e403d23f9cd63e01d46b42dd..e89d01a288285058046a17a9ebac7c359986c131 100755 (executable)
--- a/mr
+++ b/mr
@@ -212,6 +212,13 @@ Use the specified mrconfig file. The default is to use both F<~/.mrconfig>
 as well as look for a F<.mrconfig> file in the current directory, or in one
 of its parent directories.
 
+=item -f
+
+=item --force
+
+Force mr to act on repositories that would normally be skipped due to their
+configuration.
+
 =item -v
 
 =item --verbose
@@ -367,7 +374,7 @@ been at least 12 hours since the last update.
  
 Another way to use skip is for a lazy checkout. This makes mr skip
 operating on a repo unless it already exists. To enable the 
-repo, you have to explicitly check it out (using "mr -d foo checkout").
+repo, you have to explicitly check it out (using "mr --force -d foo checkout").
 
   [foo]
   checkout = ...
@@ -530,6 +537,7 @@ my $config_overridden=0;
 my $verbose=0;
 my $quiet=0;
 my $stats=0;
+my $force=0;
 my $insecure=0;
 my $interactive=0;
 my $max_depth;
@@ -693,6 +701,8 @@ sub action {
        $ENV{MR_ACTION}=$action;
        
        foreach my $testname ("skip", "deleted") {
+               next if $force && $testname eq "skip";
+
                my $testcommand=findcommand($testname, $dir, $topdir, $subdir, $is_checkout);
 
                if (defined $testcommand) {
@@ -1732,6 +1742,7 @@ sub getopts {
                "d|directory=s" => sub { $directory=abs_path($_[1]) },
                "c|config=s" => sub { $ENV{MR_CONFIG}=$_[1]; $config_overridden=1 },
                "p|path" => sub { }, # now default, ignore
+               "f|force" => \$force,
                "v|verbose" => \$verbose,
                "q|quiet" => \$quiet,
                "s|stats" => \$stats,
@@ -1848,7 +1859,7 @@ lib =
                LANG=C bzr info | egrep -q '^Checkout'
        }
        lazy() {
-               if [ "$MR_ACTION" = checkout ] || [ -d "$MR_REPO" ]; then
+               if [ -d "$MR_REPO" ]; then
                        return 1
                else
                        return 0