Git development
 help / color / mirror / Atom feed
From: Martin Langhoff <martin@catalyst.net.nz>
To: smurf@smurf.noris.de, git@vger.kernel.org
Cc: Martin Langhoff <martin@catalyst.net.nz>
Subject: [PATCH] svnimport: exit cleanly when we are up to date
Date: Thu, 15 Dec 2005 19:26:46 +1300	[thread overview]
Message-ID: <11346280062155-git-send-email-martin@catalyst.net.nz> (raw)
In-Reply-To: 

Now we detect that the SVN repo does not have new commits for us and exit
cleanly, removing the lockfile. With this, svnimport supports being run
on a cronjob to maintain a SVN2GIT gateway.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>


---

 git-svnimport.perl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

0116ebb61f1e11b3c43d4e80ac899d81f24a62d4
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 65868a9..cb241d1 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -736,6 +736,13 @@ sub commit_all {
 }
 
 $opt_l = $svn->{'maxrev'} if not defined $opt_l or $opt_l > $svn->{'maxrev'};
+
+if ($svn->{'maxrev'} < $current_rev) {
+    print "Up to date: no new revisions to fetch!\n" if $opt_v;
+    unlink("$git_dir/SVN2GIT_HEAD");
+    exit;
+}
+
 print "Fetching from $current_rev to $opt_l ...\n" if $opt_v;
 
 my $pool=SVN::Pool->new;
-- 
0.99.9.GIT

                 reply	other threads:[~2005-12-15  6:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11346280062155-git-send-email-martin@catalyst.net.nz \
    --to=martin@catalyst.net.nz \
    --cc=git@vger.kernel.org \
    --cc=smurf@smurf.noris.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox