Hello,
I was testing 4 -> svn migration and found a bug in tailor
It gave me a stack trace with:
"IndexError: list index out of range"
because there was no 'notes' element in a given revision output from a
"p4 filelog" command
The changelist which made tailor::p4 choke was a complex merge
(~1300 lines of p4 diff) with manual conflict resolution
The attached patch fixed (at least the symptom (crash)) for me and the
migration continued
smoothly...
Could you review the patch and commit it, if it is good enough ?
Let me know of any problems with it or my submission of it.
(Should I submit a request in trac ?)
2008-08-06 14:49:41 CRITICAL: Upstream change application failed
2008-08-06 14:49:41 CRITICAL: Something unexpected!
Traceback (most recent call last):
File "/home/vince/bin/tailor-0.9.35/vcpx/tailor.py", line 154, in __call__
self.update()
File "/home/vince/bin/tailor-0.9.35/vcpx/tailor.py", line 118, in update
applyable=self._applyable, applied=self._applied)
File "/home/vince/bin/tailor-0.9.35/vcpx/dualwd.py", line 102, in
applyPendingChangesets
applied=applied)
File "/home/vince/bin/tailor-0.9.35/vcpx/source.py", line 113, in
applyPendingChangesets
res = self._applyChangeset(c)
File "/home/vince/bin/tailor-0.9.35/vcpx/repository/p4/source.py",
line 108, in _applyChangeset
note = log[0]['revs'][0]['notes'][0]
IndexError: list index out of range
--
Vincent Legoll
New patches:
[fix rev['notes'] being empty stacktrace
[EMAIL PROTECTED]
Fix "IndexError: list index out of range" because there was no 'notes' in the
filelog
] {
hunk ./vcpx/repository/p4/source.py 108
- note = log[0]['revs'][0]['notes'][0]
- m = self.branchRE.match(note)
- if m:
- old = m.group('path')
- branched[old] = e
- self.log.info('Branch %r to %r' % (old, name))
+
+ # rev['notes'] may be empty
+ notes = log[0]['revs'][0]['notes']
+ if len(notes) > 0:
+ m = self.branchRE.match(notes[0])
+ if m:
+ old = m.group('path')
+ branched[old] = e
+ self.log.info('Branch %r to %r' % (old, name))
}
Context:
[Support git target renames within already-renamed directories
[EMAIL PROTECTED]
[Clear git target renaming error messages
[EMAIL PROTECTED]
[Support git target renaming of empty directories in disjunct operation
[EMAIL PROTECTED]
[tailor_git_target_disjunct_rename
[EMAIL PROTECTED]
Add a case into the git target _renamePathname() method for disjunct
directory operation. In this situation, the caller expects us to
perform the move from the old name to the new name via git, after
which it will replace the renamed file or directory with its true
contents from the source commit.
XXX Note: I am not 100% certain whether this works for directories
that have been renamed and also have files added to them in the same
commit.
]
[The `FakeLogger` needs to implement debug() too
[EMAIL PROTECTED]
[Substitute REPLACED with RENAMED when it is the case
[EMAIL PROTECTED]
This is not enough and there are still problems with the REPLACED kind
of entries: when it's a directory that gets replaced, tailor should go
down the slipping route of adding REMOVEs for entries that were
effectively deleted...
]
[Split the entries one per line
[EMAIL PROTECTED]
[Set `is_directory=True` when it is the case
[EMAIL PROTECTED]
[Sync with same P4 depot_path with which got the change list
[EMAIL PROTECTED]
[Clean up the code
[EMAIL PROTECTED]
* normalize whitespace around `==`
* factorized `fname[1:-1]`
* clarified some comments
* use `for:else:` (thx LotR!)
]
[Removed useless condition
[EMAIL PROTECTED]
Why does the monotone backend need to always commit everything instead
of the exact changes?
]
[Use `variable is None` and not `variable == None`
[EMAIL PROTECTED]
[Handle monotone timestamps with microseconds
[EMAIL PROTECTED]
[Fix Debian BTS 486604
[EMAIL PROTECTED]
Raise an error when using the same kind of VCS and same subdir.
]
[Minor optimization
[EMAIL PROTECTED]
[Rename the pending file on darcs record failures
[EMAIL PROTECTED]
[Move common import stmt at top level
[EMAIL PROTECTED]
[Be backward compatible with existing statefiles
[EMAIL PROTECTED]
Using class attributes to initialize the default values is the right way
of extending the `ChangesetEntry`, without the risk of triggering
`AttributeError` on ''old'' instances loaded from a statefile built with
a previous version of tailor.
]
[Removed wrong tests for #64
[EMAIL PROTECTED]
The reason of the failure must be searched in the source backend, CVS
in this case: it should infer the added directory.
]
[Use the `.is_directory` slot introduced by `ChangesetEntry`
[EMAIL PROTECTED]
[Move additional entry info after the name
[EMAIL PROTECTED]
[Postpone the execution of `darcs --version`
[EMAIL PROTECTED]
[[aegis] skip symlinks entries
<[EMAIL PROTECTED]>**20080609063535
Aegis does not handle symlinks as source files.
]
[[aegis] config file creation improved
<[EMAIL PROTECTED]>**20080609063219
Adds a config file if at commit time it's not yet present in the target
repository.
]
[identify symlinks entries
<[EMAIL PROTECTED]>**20080609062919
This changeset adds the ChangesetEntry.is_symlink flag (default to False).
]
[[bzr] compatibility with python < 2.5
Walter Franzini <[EMAIL PROTECTED]>**20080609054041
The code in the bzr backend contained a usage of the yield statement
forbidden before python 2.5 (inside the try part of a try:finally:).
This change-set is a workaround.
]
[[aegis] adapt the changeset even if the target repository is empty
<[EMAIL PROTECTED]>**20080606133245
Adapt the changeset even if the target repository is empty since some
thing has to be done:
* remove directory
* remove deletion of files not in the repository
* adapt renames
]
[print is_directory flag
<[EMAIL PROTECTED]>**20080606132740]
[Stderr is needed to recognize when darcs 2 is missing `pull --xml-output`
[EMAIL PROTECTED]
[Put file deletion before parent directory deletion
[EMAIL PROTECTED]
[Use rsync --delete when the target is darcs
[EMAIL PROTECTED]
The darcs target backend now writes directly to the pending file to
assemble new patches, and thus it assumes the source already applied
all the changes, in particular removed deleted files.
]
[Don't use single uppercase letter for variables
[EMAIL PROTECTED]
[Loop over a copy of the list, since we are going to remove items
[EMAIL PROTECTED]
[Always set the `.arch-ids` as an `EXTRA_METADIRS` under tla
[EMAIL PROTECTED]
[Revise logged information
[EMAIL PROTECTED]
Show the author and the timestamp of the upstream changeset, and strip
the trailing waitspace from the changelog.
]
[Show the actual exception, it may contain the error message from the backend
[EMAIL PROTECTED]
[Don't perform the post-commit-check if using `look-for-adds=True` with darcs
[EMAIL PROTECTED]
[Fix the usage of the debug option value
[EMAIL PROTECTED]
[Recognize hg directory renames
[EMAIL PROTECTED]
[Reduce hg verbosity
[EMAIL PROTECTED]
Use --quiet when `debug=False`.
]
[Handle "split-file" under hg
[EMAIL PROTECTED]
[Workaround to what seems hg merge strangeness
[EMAIL PROTECTED]
Trying to convert hg own history to darcs, tailor found several kinds
of strange patches, that is changesets that brings in entries not
shown in the patch log, or tagged as updates when the entry does not
still exist, or deleted twice in different patches.
This patch tries to fix the last two problems. My only workaround to
the first, until I find a better way if any, is to use
`looks-for-adds=True` on darcs.
]
[Show the actual changeset that triggers the error
[EMAIL PROTECTED]
[Add --ignore-times on darcs record
[EMAIL PROTECTED]
[Fix #81: handle directories add/remove under hg
[EMAIL PROTECTED]
[Removed useless import
[EMAIL PROTECTED]
[Fix typo
[EMAIL PROTECTED]
[Fix #66: Use `_hgCommand()` to copy/remove items
[EMAIL PROTECTED]
`repo.copy(source, target)` errors out with a quite surprising
"target does not exist" message.
]
[Implement the `_postCommitCheck()` method for hg
[EMAIL PROTECTED]
[Make post-commit-check True by default
[EMAIL PROTECTED]
[Ignore stderr when fetching darcs XML output
[EMAIL PROTECTED]
[Document the 'overwrite-tags' for git
[EMAIL PROTECTED]
Also, emit a critical log indicating the possible source of the
problem, mentioning the option.
]
[TAG Version 0.9.35
[EMAIL PROTECTED]
Patch bundle hash:
6741af61a5451b2da8fb4aa26159f446ca2ec97f
_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor