git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cvsimport: rewrite to use cvsps 3.x to fix major bugs

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2013, 05:20 UTC
Message-ID
<7v62339du4.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1357875152-19899-1-git-send-email-gitster@pobox.com>

I cloned git://gitorious.org/cvsps/cvsps.git and installed cvsps-3.7 at c2ce6cc (More fun with test loads, sigh. Timezones suck., 2013-01-09) earlier on my $PATH, and tried to run t96xx series with this patch applied on top of Git 1.8.1.

The first thing I noticed was that all the tests were skipped. A patch to t/lib-cvs.sh might be sufficient,

--------------------- >8 -------------------------
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 44263ad..423953f 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -17,6 +17,8 @@ cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
 case "$cvsps_version" in
 2.1 | 2.2*)
 	;;
+3.*)
+	;;
 '')
 	skip_all='skipping cvsimport tests, cvsps not found'
 	test_done
--------------------- 8< -------------------------

but I didn't check more than "now it seems not to skip them".
And here is what I got:

--------------------- >8 -------------------------
Test Summary Report
-------------------
t9600-cvsimport.sh              (Wstat: 256 Tests: 15 Failed: 9)
  Failed tests:  4-6, 8-9, 11-13, 15
  Non-zero exit status: 1
t9601-cvsimport-vendor-branch.sh (Wstat: 256 Tests: 9 Failed: 8)
  Failed tests:  1-4, 6-9
  Non-zero exit status: 1
t9602-cvsimport-branches-tags.sh (Wstat: 256 Tests: 11 Failed: 5)
  Failed tests:  1-3, 7, 9
  Non-zero exit status: 1
t9604-cvsimport-timestamps.sh   (Wstat: 256 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 1
Files=5, Tests=38,  5 wallclock secs ( 0.05 usr  0.01 sys +  0.49
  cusr  0.16 csys =  0.71 CPU)
Result: FAIL
--------------------- 8< -------------------------

A funny thing was that without cvsps-3.7 on $PATH (which means I am
getting distro packaged cvsps 2.1), I got identical errors.  Looking
at the log message, it seems that you meant to remove t960[123], so
perhaps the patch simply forgot to remove 9601 and 9602?

As neither test runs "git cvsimport" with -o/-m/-M options, ideally
we should be able to pass them with and without having cvsps-3.x.
Not passing them without cvsps-3.x would mean that the fallback mode
of rewritten cvsimport is not working as expected. Not passing them
with cvsps-3.x may mean the tests were expecting a wrong conversion
result, or they uncover bugs in the replacement cvsimport.

t9600 fails with "-a is no longer supported", even without having
cvsps-3.x on the $PATH (i.e. attempting to use the fallback).  I
wonder if this is an option the updated cvsimport would want to
simply ignore?

It is a way to tell the old cvsps/cvsimport to disable its
heuristics to ignore commits made within the last 10 minutes (this
is done in the hope of waiting for the per-file nature of CVS
commits to stabilize, IIUC); the user tells the command that he
knows that the CVS repository is now quiescent and it is safe to
import the whole thing.

If the updated cvsps can identify the changeset more reliably and it
no longer needs "-a" option, it may be more helpful to the users to
migrate their script if it allowed, warned and then ignored the
option.  It certainly would help sharing of this test script between
runs that use the old and new cvsps as backends.

t9601 (after resurrecting the t/t9601/cvsroot directory) fails in an
interesting way.

--------------------- >8 -------------------------
$ sh t9601-cvsimport-vendor-branch.sh -i -v
Initialized empty Git repository in /git/git.build/t/trash directory.t9601-cvsimport-vendor-branch/.git/
expecting success:

        git cvsimport -C module-git module

Traceback (most recent call last):
  File "/git/git.build/git-cvsimport", line 262, in <module>
    subprocess.check_output("cvsps -V 2>/dev/null", shell=True)
AttributeError: 'module' object has no attribute 'check_output'
not ok - 1 import a module with a vendor branch
--------------------- 8< -------------------------

Apparently, the copy of "subprocess.py" I have does not give us the
check_output thing:

--------------------- >8 -------------------------
$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> dir(subprocess)
['CalledProcessError', 'MAXFD', 'PIPE', 'Popen', 'STDOUT', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_active', '_cleanup', '_demo_posix', '_demo_windows', '_eintr_retry_call', 'call', 'check_call', 'errno', 'fcntl', 'gc', 'list2cmdline', 'mswindows', 'os', 'pickle', 'select', 'signal', 'sys', 'traceback', 'types']
--------------------- 8< -------------------------

The story is the same for t9602 and t9603 (again after resurrecting
the necessary files).

http://docs.python.org/2/library/subprocess.html tells me that
check_output has first become available in 2.7.

So... does this mean that we now set the minimum required version of
Python to 2.7?  I dunno.
Previous: Eric S. RaymondNext: Junio C Hamano
Message 7 of 37 in “cvsimport: rewrite to use cvsps 3.x to fix major bugs”
  1. cvsimport: rewrite to use cvsps 3.x to fix major bugsJunio C Hamano, Jan 11, 2013
  2. Junio C HamanoJan 11, 2013
  3. Eric S. RaymondJan 11, 2013
  4. Junio C HamanoJan 11, 2013
  5. Junio C HamanoJan 11, 2013
  6. Eric S. RaymondJan 12, 2013
  7. Junio C HamanoJan 12, 2013
  8. t/t960[123]: remove leftover scriptsJunio C Hamano, Jan 12, 2013
  9. Chris RorvickJan 12, 2013
  10. t/lib-cvs: cvsimport no longer works without Python >= 2.7Junio C Hamano, Jan 12, 2013
  11. Michael HaggertyJan 12, 2013
  12. John KeepingJan 13, 2013
  13. Eric S. RaymondJan 12, 2013
  14. Michael HaggertyJan 12, 2013
  15. Eric S. RaymondJan 12, 2013
  16. Jonathan NiederJan 12, 2013
  17. Jonathan NiederJan 12, 2013
  18. Junio C HamanoJan 13, 2013
  19. Junio C HamanoJan 13, 2013
  20. 0/3 A smoother transition plan for cvsimportJunio C Hamano, Jan 14, 2013
  21. 1/3 cvsimport: allow setting a custom cvsps (2.x) program nameJunio C Hamano, Jan 14, 2013
  22. 2/3 cvsimport: introduce a version-switch wrapperJunio C Hamano, Jan 14, 2013
  23. Junio C HamanoJan 14, 2013
  24. 3/3 cvsimport: start adding cvsps 3.x supportJunio C Hamano, Jan 14, 2013
  25. Chris RorvickJan 15, 2013
  26. Junio C HamanoJan 15, 2013
  27. Michael HaggertyJan 14, 2013
  28. 0/6 A smoother transition plan for cvsimportJunio C Hamano, Jan 14, 2013
  29. 1/6 Makefile: add description on PERL/PYTHON_PATHJunio C Hamano, Jan 14, 2013
  30. 2/6 cvsimport: allow setting a custom cvsps (2.x) program nameJunio C Hamano, Jan 14, 2013
  31. 3/6 cvsimport: introduce a version-switch wrapperJunio C Hamano, Jan 14, 2013
  32. 4/6 cvsimport: start adding cvsps 3.x supportJunio C Hamano, Jan 14, 2013
  33. 5/6 cvsimport: make tests reusable for cvsimport-3Junio C Hamano, Jan 14, 2013
  34. 6/6 cvsimport-3: add a sample testJunio C Hamano, Jan 14, 2013
  35. Jonathan NiederJan 14, 2013
  36. 7/6 t9600: further prepare for sharingJunio C Hamano, Jan 14, 2013
  37. 8/6 t9600: adjust for new cvsimportJunio C Hamano, Jan 14, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.