From: "Eddy Petrișor" <eddy.petrisor@gmail.com>
To: git@vger.kernel.org
Cc: Eddy Petrisor <eddy@epetrisor.dsd.ro>
Subject: [PATCH] added a test frame for git-svn-externals.sh
Date: Fri, 29 Aug 2008 03:02:59 +0300 [thread overview]
Message-ID: <1219968179-14156-3-git-send-email-eddy.petrisor@gmail.com> (raw)
In-Reply-To: <1219968179-14156-2-git-send-email-eddy.petrisor@gmail.com>
From: Eddy Petrisor <eddy@epetrisor.dsd.ro>
---
t/t9130-git-svn-externals-fetch.sh | 76 ++++++++++++++++++++++++++++++++++++
t/t9130/clean.dump | 74 +++++++++++++++++++++++++++++++++++
2 files changed, 150 insertions(+), 0 deletions(-)
create mode 100755 t/t9130-git-svn-externals-fetch.sh
create mode 100644 t/t9130/clean.dump
diff --git a/t/t9130-git-svn-externals-fetch.sh b/t/t9130-git-svn-externals-fetch.sh
new file mode 100755
index 0000000..70335ad
--- /dev/null
+++ b/t/t9130-git-svn-externals-fetch.sh
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Copyright (c) 2008 Eddy PetriÈor
+
+
+test_description='git svn properties pulls and updates externals'
+. ./lib-git-svn.sh
+
+test_expect_success 'load repository with base directory' '
+ svnadmin load -q "$rawsvnrepo" < ../t9130/clean.dump
+ '
+
+test_expect_success 'checkout the simple repo' '
+ mkdir -p gitrepo &&
+ (
+ cd gitrepo &&
+ git svn init "$svnrepo/trunk" &&
+ git svn fetch &&
+ cd ..
+ )
+ '
+
+test_expect_success 'add an external in the repo' '
+ svn checkout "$svnrepo/trunk" work.svn &&
+ (
+ cd work.svn &&
+ svn propset svn:externals "external $(echo $svnrepo|sed "s#\ #%20#")/external" . &&
+ svn commit -m "added external directory to repo" &&
+ svn update &&
+ cd .. &&
+ rm -fr work.svn
+ )
+ '
+
+test_expect_success 'git svn fetch the property changes and fetch externals' '
+ cd gitrepo &&
+ git svn rebase &&
+ git svn show-externals | grep -q "^/external" &&
+ git svn-externals &&
+ cd ..
+ '
+
+test_expect_success 'create an external pinned to a version' '
+ svn checkout "$svnrepo/trunk" work.svn &&
+ (
+ cd work.svn &&
+ svn propset svn:externals "external -r2 $(echo $svnrepo|sed "s#\ #%20#")/external" . &&
+ svn commit -m "pin the external to -r2" &&
+ svn update &&
+ cd .. &&
+ rm -fr work.svn
+ ) &&
+ svn checkout "$svnrepo/external" ext.svn &&
+ (
+ cd ext.svn &&
+ echo "0" > externalfile &&
+ svn commit -m "mark the bad floating revision for the external" &&
+ cd .. &&
+ rm -fr ext.svn
+ )
+ '
+
+test_expect_failure 'refresh revisioned externals in git' '
+ cd gitrepo &&
+ git config --list >> /tmp/test &&
+ git svn rebase &&
+ git svn-externals &&
+ grep 1 external/externalfile &&
+ cd ..
+ '
+
+#TODO: add test_expect_success for a URI change for the external
+
+
+
+test_done
diff --git a/t/t9130/clean.dump b/t/t9130/clean.dump
new file mode 100644
index 0000000..9e26b66
--- /dev/null
+++ b/t/t9130/clean.dump
@@ -0,0 +1,74 @@
+SVN-fs-dump-format-version: 2
+
+UUID: 13066bdd-4590-4b1e-8a3f-4379dfa77d1b
+
+Revision-number: 0
+Prop-content-length: 56
+Content-length: 56
+
+K 8
+svn:date
+V 27
+2008-07-10T11:26:12.351202Z
+PROPS-END
+
+Revision-number: 1
+Prop-content-length: 125
+Content-length: 125
+
+K 7
+svn:log
+V 26
+bare structure of the repo
+K 10
+svn:author
+V 4
+eddy
+K 8
+svn:date
+V 27
+2008-07-10T11:31:04.711302Z
+PROPS-END
+
+Node-path: external
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: external/externalfile
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 2
+Text-content-md5: b026324c6904b2a9cb4b88d6d61c81d1
+Content-length: 12
+
+PROPS-END
+1
+
+
+Node-path: trunk
+Node-kind: dir
+Node-action: add
+Prop-content-length: 10
+Content-length: 10
+
+PROPS-END
+
+
+Node-path: trunk/dummyfile
+Node-kind: file
+Node-action: add
+Prop-content-length: 10
+Text-content-length: 1
+Text-content-md5: 68b329da9893e34099c7d8ad5cb9c940
+Content-length: 11
+
+PROPS-END
+
+
+
--
1.5.6.3
next prev parent reply other threads:[~2008-08-29 0:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-29 0:02 [PATCH 0/3] git-svn-externals PoC (in a sh script) Eddy Petrișor
2008-08-29 0:02 ` [PATCH] git svn: should not display zombie externals Eddy Petrișor
2008-08-29 0:02 ` [PATCH] First crude implementation of git-svn-externals Eddy Petrișor
2008-08-29 0:02 ` Eddy Petrișor [this message]
2008-08-29 0:16 ` [PATCH 0/3] git-svn-externals PoC (in a sh script) Eddy Petrișor
2008-08-29 9:29 ` Eric Wong
2008-09-01 6:20 ` RFH: git-svn and submodules Eric Wong
2008-09-10 13:56 ` [PATCH 0/3] git-svn-externals PoC (in a sh script) Eddy Petrișor
2008-09-10 13:59 ` Eddy Petrișor
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=1219968179-14156-3-git-send-email-eddy.petrisor@gmail.com \
--to=eddy.petrisor@gmail.com \
--cc=eddy@epetrisor.dsd.ro \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).