Ticket #132 (closed defect: fixed)
Monotone -> Svn drops changes while remove or delete other files
| Reported by: | HenryN | Owned by: | lele |
|---|---|---|---|
| Priority: | major | Milestone: | VersionOne |
| Component: | mtn | Version: | 0.9 |
| Keywords: | Cc: |
Description
The changes on file are missing, if any other file was 'removed' or 'renamed'. Output from 'Monotone diff' sems be good. See *.diff and *.log, files have created from the same command, as found in Tailor's verbose log.
Tailor version 0.9.28 Monotone Version 0.35 svn, Version 1.3.0 (r17949).
On Monotone:
- Create branch
- add 3 files
- change file1, delete file2
- change file1, rename file3 into file4
After Tailor in Subversion seen this:
- initial injection (Monotone branch)
- This revision was complete missing
- add file1, no info about file2, add file3. Information about file2 was hidden (because rev 0 has no file2).
- missing changes on file1, rename file3/4
Changes on file1 are not in svn, but it's in the subdir 'mtnside', The rsync has worked, but the command to svn has no set to commit changes on file1.
After paching tailor with mtn-initial-revision.patch have this in Subversion:
- initial injection
- add 3 files
- missing changes on file1. Deleted file2.
- missing changes on file1. Renamed file3/4
In the step 2. and 3. the change on file1.txt was totaly loosed. The file1 contains the first initial commit "foo1" from step 1 in all revisions.
With script 'test-mtn-rename.sh' can produce this problem.
Henry N.
Change History
comment:2 in reply to: ↑ description Changed 6 years ago by HenryN
Replying to HenryN:
Fixed by follow patch:
File: monotone-rename-drops-changes.patch
Monotone: Changes on file was missing, if other will be renamed or removed.
Check with 'test-mtn-svn-rename-change.sh'.
'test-mtn-svn-back-del-ren-add-change.sh' is a more complexe test.
============================================================
--- tailor-0.9.28/vcpx/repository/monotone.py
+++ tailor-0.9.28/vcpx/repository/monotone.py
@@ -555,6 +565,22 @@
"followed by '%s','%s','%s'" % (fromw, oldr,
tow, newr))
+ # The 'chentry' is not nessesary if no other entries exist.
+ # But needs, if one entry with rename or delete exist before,
+ # because the list of modifired file will be upstream only
+ # files from this list (Monotone to Subversion).
+ # So, the best: Always list the changed files here.
+ #
+ # Add file to the list, if no rename or other entry exist.
+ flag = True
+ for i,e in enumerate(chset.entries):
+ if e.name == fname[1:-1]:
+ flag = False
+ break
+ if flag:
+ chentry = chset.addEntry(fname[1:-1], chset.revision)
+ chentry.action_kind = chentry.UPDATED
+
except StopIteration:
if in_item:
raise GetUpstreamChangesetsFailure("Unexpected end of 'diff' parsing changeset info")
The patch can download also from http://www.henrynestler.com/tailor/monotone-rename-drops-changes.patch
A testing script (test-mtn-svn-rename-change.sh), my full patch (monotone-complete-20070602.patch) and more can cownload from http://www.henrynestler.com/tailor/
Henry N.

Script test-mtn-rename.sh can not attach. Server sayed "internal error". So, included as text here...