Thanks Evgeny, please use the ML to which I'm forwarding your last message, that has a much wider audience. I cannot do it right now, but I'll try to understand the issue.

ciao, lele.

--- Begin Message ---
Lele Gaifax <[EMAIL PROTECTED]> writes:

> For the Cvs.testCvsToSubversion problem, maybe the SF project changed
> something, it fails for me as well.

I've looked into it some more, and it appears that the
normalize_cvs_rev()/compare_cvs_rev() may not always Do The Right
Thing when comparing a branchpoint to a branch.

To repro: 

* unpack the tailor-0.9.20 distribution.

* put the file ftrace.py (attached) into the tailor-0.9.20/vcpx
  subdirectory

* patch the file tailor-0.9.20/vcpx/cvsps.py with the patch that follows:

diff -c /home/zhenya/tailor-0.9.20/vcpx/.\~/cvsps.py.\~1\~ 
/home/zhenya/tailor-0.9.20/vcpx/cvsps.py
--- /home/zhenya/tailor-0.9.20/vcpx/.~/cvsps.py.~1~     Fri Dec 23 08:08:00 2005
+++ /home/zhenya/tailor-0.9.20/vcpx/cvsps.py    Wed Feb 22 18:56:53 2006
@@ -18,6 +18,10 @@
      InvocationError
 from target import SyncronizableTargetWorkingDir, TargetInitializationFailure
 
+from ftrace import trace, ltrace, untrace
+
+trace('compare_cvs_revs', 'normalize_cvs_rev')
+
 class EmptyRepositoriesFoolsMe(Exception):
     "Cannot handle empty repositories. Maybe wrong module/repository?"
 
@@ -352,8 +356,9 @@
             for m in cs.entries:
                 info = entries.getFileInfo(m.name)
                 if info:
-                    odversion = info.cvs_version
-                    applied = compare_cvs_revs(odversion, m.new_revision) >= 0
+                    print "m.name", m.name, "oldversion", info.cvs_version, 
"m.new_revision", m.new_revision
+                    oldversion = info.cvs_version
+                    applied = compare_cvs_revs(oldversion, m.new_revision) >= 0
                     if not applied:
                         break
             return applied


* run the tailor test case like this:

  ./tailor test -v Cvs.testCvsToSubversion 1>cvs2svn.stdout 2>cvs2svn.stderr

* Look at cvs2svn.stdout; 

Here's a small chunk that, I believe, illustrates the problem:

m.name skins/CMFEditions/versions_history_form.pt.metadata oldversion 1.1 
m.new_revision 1.1.2.1
 compare_cvs_revs (revstr1='1.1', revstr2=u'1.1.2.1')
     normalize_cvs_rev (rev='1.1')
     normalize_cvs_rev (rev='1.1') ==> (1, 1)
     normalize_cvs_rev (rev=u'1.1.2.1')
     normalize_cvs_rev (rev=u'1.1.2.1') ==> (1, 1, 2, 1)
 compare_cvs_revs (revstr1='1.1', revstr2=u'1.1.2.1') ==> -1

Isn't version 1.1 of this file the branch point from which 1.1.2.1 was
derived?  And, if so, shouldn't the comparison return something other
than -1?

That is, doesn't the revision history look like this?

 ----- 1.1 -- 1.2 -- 1.3 --->
         \
          \--- 1.1.2.1 -- 1.1.2.2 -->


It's entirely possible I am just confused on this point (I haven't
studied the code in normalize_cvs_rev() and compare_cvs_revs() yet,
sorry!)

Thank you for your time!

-- 
Evgeny

Attachment: ftrace.py
Description: A file to add a primitive/simple-minded \"tracing\" of functions to Python


--- End Message ---
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to