From: Jason Gross <jgross@MIT.EDU>
To: git@vger.kernel.org
Cc: Jonathan Nieder <jrnieder@gmail.com>, Jason Gross <jgross@mit.edu>
Subject: [PATCH] Add tests for handling corrupted caches
Date: Mon, 22 Aug 2011 00:10:10 -0400 [thread overview]
Message-ID: <1313986210-6536-1-git-send-email-jgross@mit.edu> (raw)
In-Reply-To: <1313979422-21286-1-git-send-email-jgross@mit.edu>
There might be a more straightforward way to generate an svn repository
with mergeinfo, but I'm not very familiar with svn.
Signed-off-by: Jason Gross <jgross@mit.edu>
---
t/t9160-git-svn-caches.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
create mode 100755 t/t9160-git-svn-caches.sh
diff --git a/t/t9160-git-svn-caches.sh b/t/t9160-git-svn-caches.sh
new file mode 100755
index 0000000..bba437a
--- /dev/null
+++ b/t/t9160-git-svn-caches.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='git svn handling of .git/svn/.caches'
+
+. ./lib-git-svn.sh
+
+say 'define NO_SVN_TESTS to skip git svn tests'
+
+test_expect_success 'initialize source svn repo' '
+ svn_cmd mkdir -m x "$svnrepo"/trunk "$svnrepo"/branches &&
+ svn_cmd co "$svnrepo" "$SVN_TREE"
+'
+
+test_expect_success 'make a change that gives mergeinfo' '
+ (
+ cd "$SVN_TREE" &&
+ touch trunk/foo &&
+ svn_cmd add trunk/foo &&
+ svn_cmd commit -m "foo" &&
+ svn_cmd up &&
+ svn_cmd cp trunk branches/1
+ svn_cmd commit -m "make branch" &&
+ svn_cmd up &&
+ touch branches/1/bar &&
+ svn_cmd add branches/1/bar &&
+ svn_cmd commit -m bar &&
+ svn_cmd up &&
+ cd trunk &&
+ svn_cmd merge ../branches/1 &&
+ svn_cmd commit -m merge &&
+ svn_cmd up
+ )
+'
+
+test_expect_success 'clone svn repo and corrupt .caches' '
+ git svn init "$svnrepo" -T trunk -b branches &&
+ git svn fetch &&
+ echo corrupted > .git/svn/.caches/lookup_svn_merge.db
+'
+
+test_expect_success 'make another change that generates mergeinfo' '
+ (
+ cd "$SVN_TREE" &&
+ touch branches/1/baz &&
+ svn_cmd commit -m baz &&
+ svn_cmd up &&
+ cd trunk &&
+ svn_cmd merge ../branches/1 &&
+ svn_cmd commit -m merge2 &&
+ svn_cmd up
+ ) &&
+ rm -rf "$SVN_TREE"
+'
+
+test_expect_success 'fetch change with mergeinfo with a corrupted cache' '
+ git svn fetch
+'
+
+test_done
--
1.7.6.558.g4b2f
next prev parent reply other threads:[~2011-08-22 4:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 2:17 [PATCH] git-svn: Destroy the cache when we fail to read it Jason Gross
2011-08-22 4:04 ` Jason Gross
2011-08-22 4:10 ` Jason Gross [this message]
2011-08-23 2:27 ` Jonathan Nieder
2011-08-23 2:36 ` Jonathan Nieder
2011-08-23 5:51 ` Jason Gross
2011-08-23 8:15 ` Eric Wong
2011-08-23 17:05 ` Junio C Hamano
2011-08-23 19:58 ` Eric Wong
2012-05-27 19:25 ` [RFC/PATCH] git-svn: use YAML format for mergeinfo cache when possible Jonathan Nieder
2012-05-27 19:48 ` [RFC/PATCH 2/1] fixup! " Jonathan Nieder
2012-05-27 20:14 ` [RFC/PATCH] " Eric Wong
2012-05-28 0:39 ` Jonathan Nieder
2012-05-28 6:57 ` [RFC/PATCH 0/2] git-svn: give SVN::Git::Fetcher its own file Jonathan Nieder
2012-05-28 7:00 ` [PATCH 1/2] git-svn: rename SVN::Git::* packages to Git::SVN::* Jonathan Nieder
2012-05-28 7:03 ` [PATCH 2/2] git-svn: make Git::SVN::Fetcher a separate file Jonathan Nieder
2012-05-29 0:25 ` [RFC/PATCH] git-svn: use YAML format for mergeinfo cache when possible Eric Wong
2012-05-29 20:48 ` Junio C Hamano
2012-06-09 22:20 ` [PATCH v2 0/3] " Jonathan Nieder
2012-06-09 22:25 ` [PATCH 1/3] git-svn: make Git::SVN::Editor a separate file Jonathan Nieder
2012-06-09 22:28 ` [PATCH 2/3] git-svn: make Git::SVN::RA " Jonathan Nieder
2012-06-09 22:35 ` [PATCH 3/3] git-svn: use YAML format for mergeinfo cache when possible Jonathan Nieder
2012-06-13 1:34 ` Jonathan Nieder
2012-06-10 9:00 ` [PATCH v2 0/3] " Eric Wong
2012-06-10 10:04 ` Jonathan Nieder
2012-06-11 15:06 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313986210-6536-1-git-send-email-jgross@mit.edu \
--to=jgross@mit.edu \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).