Fix the special case: Only one revision to read from monotone

Example (tested with test-mtn2svn-1revision.sh or test-mtn2mtn-1revision.sh)
# ----------------------------------------
# 23:13:15 [C] Checkout of project failed!
# Traceback (most recent call last):
#   File "/home/hn/bin/tailor", line 35, in ?
#     main()
#   File "vcpx/tailor.py", line 339, in main
#   File "vcpx/tailor.py", line 144, in __call__
#   File "vcpx/tailor.py", line 74, in bootstrap
#   File "vcpx/source.py", line 253, in checkoutUpstreamRevision
# File "vcpx/repository/monotone.py", line 781, in _checkoutUpstreamRevision
#     self.repository.rootdir)
#   File "vcpx/repository/monotone.py", line 726, in _convert_head_initial
#     effective_rev=revlist[0]
# IndexError: list index out of range
# ----------------------------------------

============================================================
--- tailor-20070604/vcpx/repository/monotone.py
+++ tailor-20070604/vcpx/repository/monotone.py
@@ -710,6 +710,9 @@
raise InvocationError("Can't find an INITIAL revision on branch '%s'."
                                               % module)
                     effective_rev=first_cset[0].revision
+                elif len(revlist)==0:
+ # Special case: only one revision in branch - is the head self
+                    effective_rev=revision[0]
                 else:
                     effective_rev=revlist[0]
         return effective_rev
============================================================

Complete Monotone Patch and test scripts have on http://www.henrynestler.com/tailor/

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

Reply via email to