merge patch error:IndexError: list index out of range

Bug #594958 reported by Michael Brewer
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Incomplete
Undecided
Unassigned

Bug Description

I am getting the above error from trying to merge a Patch I have been emailed into my main trunk folder. I have merged a patch before to this trunk without any errors so I am confused as to why I am having problems this time. Below is the bizaar report:

Run command: bzr merge "C:/Users/owner/Documents/Brewer data file/data/caving surveys/th_RiwakaCaveSystemData/trunk/BruceDoodlesBranch-28.pat...
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 853, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1055, in run_bzr
  File "bzrlib\commands.pyo", line 661, in run_argv_aliases
  File "bzrlib\commands.pyo", line 665, in run_direct
  File "bzrlib\cleanup.pyo", line 122, in run_simple
  File "bzrlib\cleanup.pyo", line 156, in _do_with_cleanups
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commands.py", line 788, in run
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\subprocess.py", line 786, in run_subprocess_command
  File "bzrlib\commands.pyo", line 1055, in run_bzr
  File "bzrlib\commands.pyo", line 661, in run_argv_aliases
  File "bzrlib\commands.pyo", line 665, in run_direct
  File "bzrlib\cleanup.pyo", line 122, in run_simple
  File "bzrlib\cleanup.pyo", line 156, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 3783, in run
  File "bzrlib\merge.pyo", line 321, in from_mergeable
  File "bzrlib\merge_directive.pyo", line 240, in install_revisions
  File "bzrlib\bundle\serializer\v4.pyo", line 471, in install_revisions
  File "bzrlib\bundle\serializer\v4.pyo", line 539, in install
  File "bzrlib\bundle\serializer\v4.pyo", line 569, in _install_in_write_group
  File "bzrlib\bundle\serializer\v4.pyo", line 690, in _install_inventory_records
  File "bzrlib\multiparent.pyo", line 167, in to_lines
  File "bzrlib\multiparent.pyo", line 502, in get_line_list
  File "bzrlib\multiparent.pyo", line 512, in cache_version
  File "bzrlib\multiparent.pyo", line 661, in reconstruct_version
  File "bzrlib\multiparent.pyo", line 654, in _reconstruct
IndexError: list index out of range

bzr 2.1.1 on python 2.5.4 (Windows-Vista-6.1.7600)
arguments: ['C:\\Program Files\\Bazaar\\bzr.exe', 'qsubprocess', '--bencode', 'l5:merge119:C:/Users/owner/Documents/Brewer data file/data/caving surveys/th_RiwakaCaveSystemData/trunk/BruceDoodlesBranch-28.patch11:--directory91:C:/Users/owner/Documents/Brewer data file/data/caving surveys/th_RiwakaCaveSystemData/trunke']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.1.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.0.1]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.1.1]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store [2.1.1]
  news_merge C:\Program Files\Bazaar\plugins\news_merge [2.1.1]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.18.4]
  rebase C:\Program Files\Bazaar\plugins\rebase [0.5.5]
  svn C:\Program Files\Bazaar\plugins\svn [1.0.2]
  upload C:\Program Files\Bazaar\plugins\upload [1.0.0dev]
  xmloutput C:\Program Files\Bazaar\plugins\xmloutput [0.8.7.dev]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Revision history for this message
Bruce Mutton (dangle) wrote :
Download full text (3.8 KiB)

Ditto me. Have successfully merged patch into my trunk once previously, and a number of local feature branch merges as well.
Now patch command (not tried by me before) gives messages like;

Run command: bzr patch "C:/Documents and Settings/Bruce/My Documents/Bruce/Outdoor/Cave/Therion Data and Notes/th_RiwakaCaveSystemData/MikesS...
bzr: ERROR: Error invoking patch: No such file or directory

Run command: bzr patch ../MikesSwissMaidBranch-28.patch
bzr: ERROR: Error invoking patch: No such file or directory

and merge gives message like;

bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 853, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1055, in run_bzr
  File "bzrlib\commands.pyo", line 661, in run_argv_aliases
  File "bzrlib\commands.pyo", line 665, in run_direct
  File "bzrlib\cleanup.pyo", line 122, in run_simple
  File "bzrlib\cleanup.pyo", line 156, in _do_with_cleanups
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commands.py", line 788, in run
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\subprocess.py", line 786, in run_subprocess_command
  File "bzrlib\commands.pyo", line 1055, in run_bzr
  File "bzrlib\commands.pyo", line 661, in run_argv_aliases
  File "bzrlib\commands.pyo", line 665, in run_direct
  File "bzrlib\cleanup.pyo", line 122, in run_simple
  File "bzrlib\cleanup.pyo", line 156, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 3783, in run
  File "bzrlib\merge.pyo", line 321, in from_mergeable
  File "bzrlib\merge_directive.pyo", line 240, in install_revisions
  File "bzrlib\bundle\serializer\v4.pyo", line 471, in install_revisions
  File "bzrlib\bundle\serializer\v4.pyo", line 539, in install
  File "bzrlib\bundle\serializer\v4.pyo", line 569, in _install_in_write_group
  File "bzrlib\bundle\serializer\v4.pyo", line 690, in _install_inventory_records
  File "bzrlib\multiparent.pyo", line 167, in to_lines
  File "bzrlib\multiparent.pyo", line 502, in get_line_list
  File "bzrlib\multiparent.pyo", line 512, in cache_version
  File "bzrlib\multiparent.pyo", line 661, in reconstruct_version
  File "bzrlib\multiparent.pyo", line 654, in _reconstruct
IndexError: list index out of range

bzr 2.1.1 on python 2.5.4 (Windows-XP-5.1.2600-SP3)
arguments: ['C:\\Program Files\\Bazaar\\bzr.exe', 'qsubprocess', '--bencode', 'l5:merge140:C:/Documents and Settings/Bruce/My Documents/Bruce/Outdoor/Cave/Therion Data and Notes/th_RiwakaCaveSystemData/MikesSwissMaidBranch-28.patch11:--directory116:C:/Documents and Settings/Bruce/My Documents/Bruce/Outdoor/Cave/Therion Data and Notes/th_RiwakaCaveSystemData/trunke']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.1.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.0.1]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.1.1]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store [2.1.1]
  news_merge C:\Program Files\Bazaar\plugins\news_merge [2.1.1]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.18.4]
  rebase C...

Read more...

Revision history for this message
Robert Collins (lifeless) wrote :

Hi, this bug appears to mean that the patch is either incomplete or damaged. How did you generate it?

Changed in bzr:
status: New → Incomplete
Revision history for this message
Robert Collins (lifeless) wrote :

See also bug 598202 for a candidate dupe.

Revision history for this message
Alexander Belchenko (bialix) wrote :

I've just tried to generate a merge directive with qbzr (qsend command) which is used in the bzr-explorer. Save patch to file and then trying to merge it with `bzr merge patch-file`. Everything is OK.

My best guess there is problem with line-endings.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Stab in the dark: if patch have LF-only or mixed line-endings and it have been sent via e-mail, then e-mail client may force CRLF when save attachment. Therefore the patch saved from e-mail attachment will be different from the one generated on the remote machine.

Revision history for this message
Matthäus G. Chajdas (anteru) wrote :

The generated patch contains mixed CR/LF and LF linefeeds. The file was not send by mail from machine-a to b, but copied using RDP.

Revision history for this message
Matthäus G. Chajdas (anteru) wrote :

Bah, the last comment is for bug #598202, i.e. that is the patch generated there, not for this bug.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 594958] Re: merge patch error:IndexError: list index out of range

Matthäus G. Chajdas пишет:
> The generated patch contains mixed CR/LF and LF linefeeds. The file was
> not send by mail from machine-a to b, but copied using RDP.

Can you compare size and/or MD5 of the original patch and the copied one
to check they're the same? Maybe RDP have "fixed" line-endings to be
CRLF only without notifying you?

Revision history for this message
Bruce Mutton (dangle) wrote :

Here is the background story of these matching bugs. Hope it will help
1. Michael and Bruce are both bazaar newbies.
2. Trunk created on Bruce's machine
3. Trunk branched to USB drive then again branched to Michaels machine
4. Michael & Bruce each make their own (different) feature branches ...
5. ... and after some edits send each other patches and successfully merge patches with their respective trunks. They then successfully merge their own feature branches with their trunks.
6. They each push/pull changes from trunk to their own feature branch.
7. Repeat from step 5. except that this time the patches crash as initially reported for this bug for BOTH Bruce and Michael.

8. We lay low for a while, then Bruce pushes his trunk and feature branch changes to USB drive.
9. He drives 40 minutes to Michaels place, and manages to merge etc until both trunks and feature branches are up to date, drives 40 minutes home and pushes changes back to his trunk feature branch on his machine.

10. Repeat step 5. this time with success.
11. Michael makes the deduction that step 6. was what 'broke' our system, so we keep repeating step 5.

So far I think we have two to three successful repeats each of step 5.

Only slight problem is that our feature branches are becoming more and more out of date.
Was the cause of this 'bug' an error of procedure on our part?
If so, what is the proper way to keep feature branches up to date? Delete them (working tree and .bzr) and recreate them with a new branch command?

Revision history for this message
Matthäus G. Chajdas (anteru) wrote :

I really doubt RDP changes line-endings, after all, I copied the file as is (which should be equal to a binary copy.) RDP is not a file-transfer protocol like FTP ....

Revision history for this message
Bruce Mutton (dangle) wrote :
Download full text (3.7 KiB)

Got this same error just now using 2.1.1 (which I guess the creator of the patch was using) and again after installing 2.2.0
Transcript follows...

Run command: bzr merge "C:/Documents and Settings/Bruce/My Documents/Bruce/Outdoor/Cave/Therion Data and Notes/th_RiwakaCaveSystemData/39-Mik...
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 911, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1111, in run_bzr
  File "bzrlib\commands.pyo", line 689, in run_argv_aliases
  File "bzrlib\commands.pyo", line 704, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\commands.py", line 767, in run
  File "C:/Program Files/Bazaar/plugins\qbzr\lib\subprocess.py", line 869, in run_subprocess_command
  File "bzrlib\commands.pyo", line 1111, in run_bzr
  File "bzrlib\commands.pyo", line 689, in run_argv_aliases
  File "bzrlib\commands.pyo", line 704, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 3843, in run
  File "bzrlib\merge.pyo", line 368, in from_mergeable
  File "bzrlib\merge_directive.pyo", line 278, in install_revisions
  File "bzrlib\bundle\serializer\v4.pyo", line 471, in install_revisions
  File "bzrlib\bundle\serializer\v4.pyo", line 539, in install
  File "bzrlib\bundle\serializer\v4.pyo", line 569, in _install_in_write_group
  File "bzrlib\bundle\serializer\v4.pyo", line 690, in _install_inventory_records
  File "bzrlib\multiparent.pyo", line 167, in to_lines
  File "bzrlib\multiparent.pyo", line 502, in get_line_list
  File "bzrlib\multiparent.pyo", line 512, in cache_version
  File "bzrlib\multiparent.pyo", line 661, in reconstruct_version
  File "bzrlib\multiparent.pyo", line 654, in _reconstruct
IndexError: list index out of range

bzr 2.2.0 on python 2.6.4 (Windows-XP-5.1.2600-SP3)
arguments: ['C:\\Program Files\\Bazaar\\bzr.exe', 'qsubprocess', '--bencode', 'l5:merge142:C:/Documents and Settings/Bruce/My Documents/Bruce/Outdoor/Cave/Therion Data and Notes/th_RiwakaCaveSystemData/39-MikesCelebrationSeries.Patch11:--directory116:C:/Documents and Settings/Bruce/My Documents/Bruce/Outdoor/Cave/Therion Data and Notes/th_RiwakaCaveSystemData/trunke']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.2.0]
  colo C:\Program Files\Bazaar\plugins\colo [0.1.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.1b1]
  fastimport C:\Program Files\Bazaar\plugins\fastimport [0.9.0dev]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.2.0]
  loom C:\Program Files\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store [2.2.0]
  news_merge C:\Program Files\Bazaar\plugins\news_merge [2.2.0]
  pipeline C:\Program Files\Bazaar\plugins\pipeline [unknown]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.19.0...

Read more...

Revision history for this message
Ron Rondis (ron-rondis) wrote :

Got the same error (#668399). In my case it can't be conversion problem because all was done locally (during source control evaluation process). Also the bundle look like base64 so line ending can't affect it.

The bug is dated 2010-06-16 and is still not assigned, from my point of view this bug is a blocker.

Revision history for this message
Ron Rondis (ron-rondis) wrote :

I tried duplicate the bug, did not get the trace but I did get different result as I reported on bug #668399 (merge from file vs merge from branch). Following the scenario.

bzr init main
cd main
echo main > main.cpp
bzr add
bzr commit -m main1
cd ..
bzr branch main repo1
bzr branch main repo2
cd repo1
for ((i = 1; i <= 20; i++)) do echo $i > $i.file ; done
bzr add
bzr commit -m "repo1-1"
cd ../main
bzr merge /tmp/merge.input
bzr commit -m main-merge-1
cd ../repo1
echo aaaa >> 1.file
bzr commit -m "repo1-2"
echo bbbb >> 1.file
bzr commit -m "repo1-3"
echo dddd >> 1.file
bzr commit -m "repo1-4"
echo cccc >> 1.file
bzr commit -m "repo1-5"
bzr send -o /tmp/merge.input
cd ../main
bzr merge /tmp/merge.input
bzr commit -m main-merge-2
cd ../repo2
bzr pull
echo 1111 >> 19.file
bzr commit -m reop2-1
echo 2222 >> 20.file
bzr commit -m reop2-2
cd ../main
bzr merge ../repo2
bzr commit -m main-merge-3
cd ../repo1
echo ffff >> 11.file
bzr commit -m repo1-6
bzr merge
bzr commit -m merge-1
echo eeee >> 11.file
bzr commit -m repo1-7
cd ../repo2
echo 7777 >> 20.file
bzr commit -m reop2-3
bzr send -o /tmp/merge.input
cd ../main
bzr merge /tmp/merge.input
bzr commit -m main-merge-4
cd ../repo1
bzr merge
bzr commit -m merge-2
echo kkkk >> 11.file
bzr commit -m repo1-8
bzr send -o /tmp/merge.input
cd ../main
bzr merge /tmp/merge.input
bzr commit -m main-merge-5
cd ../repo2
echo aaaa >> 13.file
bzr commit -m reop2-4
cd ../main
bzr merge ../repo2
bzr commit -m main-merge-6
cd ../repo2
bzr pull
echo 77777 >> 7.file
bzr commit -m repo2-last-1
bzr commit -m repo2-last-2
cd ../repo1
bzr pull
echo fffff >> 18.file
bzr commit -m a
echo fffff >> 18.file
bzr commit -m b
echo fffff >> 18.file
bzr commit -m c
bzr send -r 8 -o /tmp/merge.input
cd ../main
bzr merge /tmp/merge.input
bzr commit -m pick-1
cd ../repo1
bzr send -r 9 -o /tmp/merge.input
cd ../main
bzr merge /tmp/merge.input
bzr commit -m pick-2
cd ../repo1
bzr merge
bzr commit -m 'merge after pick'
echo 11111 >> 1.file
bzr commit -m n1
bzr merge ../reop2
bzr commit -m merge-from-repo2
echo 22222 >> 1.file
bzr commit -m n2
bzr send -o /tmp/merge.input
cd ../main

The following result with different result
 bzr merge /tmp/merge.input
 bzr merge ../repo1

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.