{"thread":{"id":"20387","subject":"[PATCH 13/13] Changes for new vcs-helper series","startedAt":"2009-08-05T05:02:25Z","lastAt":"2009-08-05T05:02:25Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":13},"messages":[{"id":"119567","messageId":"alpine.LNX.2.00.0908050056210.2147@iabervon.org","threadId":"20387","inReplyTo":null,"subject":"[PATCH 13/13] Changes for new vcs-helper series","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-08-05T05:02:25Z","receivedAt":"2009-08-05T05:02:25Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"These changes are:\n\n - helper is called git remote-<name>, no longer git vcs-<name>\n - import capability has to be declared\n - refs in list have to be prefixed with '?' for unknown sha1\n - command line must be \"git remote-<name> <remote> [<url>]\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n Makefile                            |    2 +-\n git-vcs-cvs.py => git-remote-cvs.py |    7 +--\n t/t9800-foreign-vcs-cvs-basic.sh    |   82 ++++++++++++++++++-----------------\n t/t9801-foreign-vcs-cvs-fetch.sh    |    6 +-\n 4 files changed, 49 insertions(+), 48 deletions(-)\n rename git-vcs-cvs.py => git-remote-cvs.py (99%)\n\ndiff --git a/Makefile b/Makefile\nindex 98f0782..958c49f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -344,7 +344,7 @@ SCRIPT_PERL += git-relink.perl\n SCRIPT_PERL += git-send-email.perl\n SCRIPT_PERL += git-svn.perl\n \n-SCRIPT_PYTHON += git-vcs-cvs.py\n+SCRIPT_PYTHON += git-remote-cvs.py\n \n SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \\\n \t  $(patsubst %.perl,%,$(SCRIPT_PERL)) \\\ndiff --git a/git-vcs-cvs.py b/git-remote-cvs.py\nsimilarity index 99%\nrename from git-vcs-cvs.py\nrename to git-remote-cvs.py\nindex 04a52a6..b43138d 100755\n--- a/git-vcs-cvs.py\n+++ b/git-remote-cvs.py\n@@ -482,7 +482,7 @@ def do_list (*args):\n \t\telse:\n \t\t\ts = \" changed\"\n \t\t\tchanged += 1\n-\t\tprint \"%s%s\" % (git_ref, s)\n+\t\tprint \"? %s%s\" % (git_ref, s)\n \n \tprogress.finish(\"Found %i CVS symbols (%i changed, %i unchanged)\" % (\n \t                changed + unchanged, changed, unchanged))\n@@ -492,6 +492,7 @@ def do_list (*args):\n def do_capabilities (*args):\n \t\"\"\"Do the 'capabilities' command; report supported features\"\"\"\n \tif args: die_usage(\"'capabilities' takes no parameters\")\n+\tprint \"import\"\n \tprint \"marks %s\" % (work_path(\"marks\"))\n #\tprint \"export\"\n #\tprint \"export-branch\"\n@@ -630,10 +631,8 @@ def main (*args):\n \t### Main program loop\n \n \timport_refs = [] # accumulate import commands here\n-\t# iterate over command lines on command line, then standard input\n \t# cannot use \"for line in sys.stdin\" for buffering (?) reasons\n-\tline = \" \".join(args[2:])\n-\tif not line: line = sys.stdin.readline()\n+\tline = sys.stdin.readline()\n \twhile (line):\n \t\tcmdline = line.strip().split()\n \t\tif not cmdline: break # blank line means we're about to quit\ndiff --git a/t/t9800-foreign-vcs-cvs-basic.sh b/t/t9800-foreign-vcs-cvs-basic.sh\nindex 78f5a98..e318c62 100755\n--- a/t/t9800-foreign-vcs-cvs-basic.sh\n+++ b/t/t9800-foreign-vcs-cvs-basic.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n \n-test_description='git vcs-cvs basic tests'\n+test_description='git remote-cvs basic tests'\n . ./test-lib.sh\n \n if ! test_have_prereq PYTHON; then\n@@ -21,7 +21,7 @@ GITREMOTE=cvsremote\n \n if ! type $CVS_EXEC >/dev/null 2>&1\n then\n-\tsay 'skipping vcs-cvs tests, $CVS_EXEC not found'\n+\tsay 'skipping remote-cvs tests, $CVS_EXEC not found'\n \ttest_done\n fi\n \n@@ -72,10 +72,11 @@ test_expect_success 'set up CVS repo as a foreign remote' '\n \n '\n \n-test_expect_success '#1: git-vcs-cvs \"capabilities\" command' '\n+test_expect_success '#1: git-remote-cvs \"capabilities\" command' '\n \n-\techo \"capabilities\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"capabilities\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n+import\n marks .git/info/cvs/$GITREMOTE/marks\n \n EOF\n@@ -83,20 +84,20 @@ EOF\n \n '\n \n-test_expect_success '#1: git-vcs-cvs \"list\" command' '\n+test_expect_success '#1: git-remote-cvs \"list\" command' '\n \n-\techo \"list\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"list\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n-refs/cvs/$GITREMOTE/HEAD changed\n+? refs/cvs/$GITREMOTE/HEAD changed\n \n EOF\n \ttest_cmp expect actual\n \n '\n \n-test_expect_success '#1: git-vcs-cvs \"import\" command' '\n+test_expect_success '#1: git-remote-cvs \"import\" command' '\n \n-\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n # Importing CVS revision o_fortuna:1.1\n blob\n@@ -166,7 +167,7 @@ EOF\n \n '\n \n-test_expect_success '#1: Passing git-vcs-cvs output to git-fast-import' '\n+test_expect_success '#1: Passing git-remote-cvs output to git-fast-import' '\n \n \tgit fast-import --quiet \\\n \t\t--export-marks=\".git/info/cvs/$GITREMOTE/marks\" \\\n@@ -177,7 +178,7 @@ test_expect_success '#1: Passing git-vcs-cvs output to git-fast-import' '\n \n test_expect_success '#1: Verifying correctness of import' '\n \n-\techo \"verify HEAD\" | git vcs-cvs \"$GITREMOTE\"\n+\techo \"verify HEAD\" | git remote-cvs \"$GITREMOTE\"\n \n '\n \n@@ -211,10 +212,11 @@ EOF\n \t)\n '\n \n-test_expect_success '#2: git-vcs-cvs \"capabilities\" command' '\n+test_expect_success '#2: git-remote-cvs \"capabilities\" command' '\n \n-\techo \"capabilities\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"capabilities\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n+import\n marks .git/info/cvs/$GITREMOTE/marks\n \n EOF\n@@ -222,20 +224,20 @@ EOF\n \n '\n \n-test_expect_success '#2: git-vcs-cvs \"list\" command' '\n+test_expect_success '#2: git-remote-cvs \"list\" command' '\n \n-\techo \"list\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"list\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n-refs/cvs/$GITREMOTE/HEAD changed\n+? refs/cvs/$GITREMOTE/HEAD changed\n \n EOF\n \ttest_cmp expect actual\n \n '\n \n-test_expect_success '#2: git-vcs-cvs \"import\" command' '\n+test_expect_success '#2: git-remote-cvs \"import\" command' '\n \n-\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n # Importing CVS revision o_fortuna:1.2\n blob\n@@ -300,7 +302,7 @@ commit 9\n commit refs/cvs/$GITREMOTE/_metadata\n mark :15\n data 39\n-Updated metadata used by \"git vcs-cvs\"\n+Updated metadata used by \"git remote-cvs\"\n \n from refs/cvs/$GITREMOTE/_metadata^0\n M 644 :12 CVS/marks\n@@ -313,7 +315,7 @@ EOF\n \n '\n \n-test_expect_success '#2: Passing git-vcs-cvs output to git-fast-import' '\n+test_expect_success '#2: Passing git-remote-cvs output to git-fast-import' '\n \n \tgit fast-import --quiet \\\n \t\t--import-marks=\".git/info/cvs/$GITREMOTE/marks\" \\\n@@ -325,7 +327,7 @@ test_expect_success '#2: Passing git-vcs-cvs output to git-fast-import' '\n \n test_expect_success '#2: Verifying correctness of import' '\n \n-\techo \"verify HEAD\" | git vcs-cvs \"$GITREMOTE\"\n+\techo \"verify HEAD\" | git remote-cvs \"$GITREMOTE\"\n \n '\n \n@@ -340,9 +342,9 @@ test_expect_success '#3: update cvs module' '\n \n '\n \n-test_expect_success '#3: git-vcs-cvs \"capabilities\" command' '\n+test_expect_success '#3: git-remote-cvs \"capabilities\" command' '\n \n-\techo \"capabilities\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"capabilities\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n marks .git/info/cvs/$GITREMOTE/marks\n \n@@ -351,9 +353,9 @@ EOF\n \n '\n \n-test_expect_success '#3: git-vcs-cvs \"list\" command' '\n+test_expect_success '#3: git-remote-cvs \"list\" command' '\n \n-\techo \"list\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"list\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n refs/cvs/$GITREMOTE/HEAD changed\n \n@@ -362,9 +364,9 @@ EOF\n \n '\n \n-test_expect_success '#3: git-vcs-cvs \"import\" command' '\n+test_expect_success '#3: git-remote-cvs \"import\" command' '\n \n-\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n # Importing CVS revision tick:1.1\n blob\n@@ -390,7 +392,7 @@ tick:1.1\n commit refs/notes/cvs/$GITREMOTE\n mark :19\n data 43\n-Annotate commits imported by \"git vcs-cvs\"\n+Annotate commits imported by \"git remote-cvs\"\n \n from refs/notes/cvs/$GITREMOTE^0\n N :18 :17\n@@ -416,7 +418,7 @@ commit 17\n commit refs/cvs/$GITREMOTE/_metadata\n mark :23\n data 39\n-Updated metadata used by \"git vcs-cvs\"\n+Updated metadata used by \"git remote-cvs\"\n \n from refs/cvs/$GITREMOTE/_metadata^0\n M 644 :20 CVS/marks\n@@ -429,7 +431,7 @@ EOF\n \n '\n \n-test_expect_success '#3: Passing git-vcs-cvs output to git-fast-import' '\n+test_expect_success '#3: Passing git-remote-cvs output to git-fast-import' '\n \n \tgit fast-import --quiet \\\n \t\t--import-marks=\".git/info/cvs/$GITREMOTE/marks\" \\\n@@ -441,13 +443,13 @@ test_expect_success '#3: Passing git-vcs-cvs output to git-fast-import' '\n \n test_expect_success '#3: Verifying correctness of import' '\n \n-\techo \"verify HEAD\" | git vcs-cvs \"$GITREMOTE\"\n+\techo \"verify HEAD\" | git remote-cvs \"$GITREMOTE\"\n \n '\n \n-test_expect_success '#4: git-vcs-cvs \"capabilities\" command' '\n+test_expect_success '#4: git-remote-cvs \"capabilities\" command' '\n \n-\techo \"capabilities\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"capabilities\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n marks .git/info/cvs/$GITREMOTE/marks\n \n@@ -456,9 +458,9 @@ EOF\n \n '\n \n-test_expect_success '#4: git-vcs-cvs \"list\" command' '\n+test_expect_success '#4: git-remote-cvs \"list\" command' '\n \n-\techo \"list\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"list\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n refs/cvs/$GITREMOTE/HEAD unchanged\n \n@@ -467,9 +469,9 @@ EOF\n \n '\n \n-test_expect_success '#4: git-vcs-cvs \"import\" command' '\n+test_expect_success '#4: git-remote-cvs \"import\" command' '\n \n-\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git vcs-cvs \"$GITREMOTE\" > actual &&\n+\techo \"import refs/cvs/$GITREMOTE/HEAD\" | git remote-cvs \"$GITREMOTE\" > actual &&\n \tcat <<EOF >expect &&\n blob\n mark :24\n@@ -486,7 +488,7 @@ data 94\n commit refs/cvs/$GITREMOTE/_metadata\n mark :27\n data 39\n-Updated metadata used by \"git vcs-cvs\"\n+Updated metadata used by \"git remote-cvs\"\n \n from refs/cvs/$GITREMOTE/_metadata^0\n M 644 :24 CVS/marks\n@@ -499,7 +501,7 @@ EOF\n \n '\n \n-test_expect_success '#4: Passing git-vcs-cvs output to git-fast-import' '\n+test_expect_success '#4: Passing git-remote-cvs output to git-fast-import' '\n \n \tgit fast-import --quiet \\\n \t\t--import-marks=\".git/info/cvs/$GITREMOTE/marks\" \\\n@@ -511,7 +513,7 @@ test_expect_success '#4: Passing git-vcs-cvs output to git-fast-import' '\n \n test_expect_success '#4: Verifying correctness of import' '\n \n-\techo \"verify HEAD\" | git vcs-cvs \"$GITREMOTE\"\n+\techo \"verify HEAD\" | git remote-cvs \"$GITREMOTE\"\n \n '\n \ndiff --git a/t/t9801-foreign-vcs-cvs-fetch.sh b/t/t9801-foreign-vcs-cvs-fetch.sh\nindex 62a2325..93d44a7 100755\n--- a/t/t9801-foreign-vcs-cvs-fetch.sh\n+++ b/t/t9801-foreign-vcs-cvs-fetch.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n \n-test_description='git vcs-cvs basic tests'\n+test_description='git remote-cvs basic tests'\n . ./test-lib.sh\n \n if ! test_have_prereq PYTHON; then\n@@ -21,14 +21,14 @@ GITREMOTE=cvsremote\n \n if ! type $CVS_EXEC >/dev/null 2>&1\n then\n-\tsay 'skipping vcs-cvs tests, $CVS_EXEC not found'\n+\tsay 'skipping remote-cvs tests, $CVS_EXEC not found'\n \ttest_done\n fi\n \n verify () {\n \tgit log --reverse --format=\"--- %T%n%s%n%n%b\" \"$GITREMOTE/$1\" >actual &&\n \ttest_cmp \"expect.$1\" actual &&\n-\techo \"verify $1\" | git vcs-cvs \"$GITREMOTE\"\n+\techo \"verify $1\" | git remote-cvs \"$GITREMOTE\"\n }\n \n test_expect_success 'setup CVS repo' '$CVS init'\n-- \n1.6.4.rc3.27.g95032.dirty\n"}]}