{"thread":{"id":"2849","subject":"[PATCH] svnimport: exit cleanly when we are up to date","startedAt":"2005-12-15T06:26:46Z","lastAt":"2005-12-15T06:26:46Z","messageCount":1,"participants":["Martin Langhoff"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"13671","messageId":"11346280062155-git-send-email-martin@catalyst.net.nz","threadId":"2849","inReplyTo":null,"subject":"[PATCH] svnimport: exit cleanly when we are up to date","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2005-12-15T06:26:46Z","receivedAt":"2005-12-15T06:26:46Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"Now we detect that the SVN repo does not have new commits for us and exit\ncleanly, removing the lockfile. With this, svnimport supports being run\non a cronjob to maintain a SVN2GIT gateway.\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n\n\n---\n\n git-svnimport.perl |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\n0116ebb61f1e11b3c43d4e80ac899d81f24a62d4\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 65868a9..cb241d1 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -736,6 +736,13 @@ sub commit_all {\n }\n \n $opt_l = $svn->{'maxrev'} if not defined $opt_l or $opt_l > $svn->{'maxrev'};\n+\n+if ($svn->{'maxrev'} < $current_rev) {\n+    print \"Up to date: no new revisions to fetch!\\n\" if $opt_v;\n+    unlink(\"$git_dir/SVN2GIT_HEAD\");\n+    exit;\n+}\n+\n print \"Fetching from $current_rev to $opt_l ...\\n\" if $opt_v;\n \n my $pool=SVN::Pool->new;\n-- \n0.99.9.GIT\n"}]}