bad conflict indication on unshelving partial shelve

Bug #783296 reported by IWATA Hidetaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Low
Unassigned

Bug Description

Steps to reproduce.

1. Create text file and commit it, content of which is
  Line01 |A
  Line02 |B
  Line03 |C
  Line04 |D

2. Edit this file as
  Line01 |A
  Line02 |x
  Line03 |y
  Line04 |D

3. Execute shelve, and shelve *line2 only*, by using change editor.
  Line01 |A
  Line02 |B
  Line03 |y
  Line04 |D

it seems to be done successfully, but this shelf can't be unshelved correctly.
Result of unshelve is
  Line01 |A
  Line02 |<<<<<<<
  Line03 |B
  Line04 |<<<<<<< TREE
  Line05 |y
  Line06 |=======
  Line07 |C
  Line08 |=======
  Line09 |x
  Line10 |y
  Line11 |>>>>>>>
  Line12 |>>>>>>> MERGE-SOURCE
  Line13 |D

VERSION INFO:
Bazaar (bzr) 2.4b1
  Python interpreter: C:\DEVELOP\py_envs\bzr2.4\Scripts\python.exe 2.6.6
  Python standard library: C:\DEVELOP\py_envs\bzr2.4\lib
  Platform: Windows-7-6.1.7600
  bzrlib: C:\DEVELOP\py_envs\bzr2.4\lib\site-packages\bzrlib
  Bazaar configuration: C:\Users\iwata\AppData\Roaming\bazaar\2.0
  Bazaar log file: C:\Users\iwata\Documents\.bzr.log

Tags: shelf
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 783296] [NEW] shelve : Failed to unshelve changes which was made by partial hunk shelving.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/16/2011 06:59 AM, iwata wrote:
> Public bug reported:
>
> Steps to reproduce.
>
> 1. Create text file and commit it, content of which is
> Line01 |A
> Line02 |B
> Line03 |C
> Line04 |D
>
> 2. Edit this file as
> Line01 |A
> Line02 |x
> Line03 |y
> Line04 |D
>
> 3. Execute shelve, and shelve *line2 only*, by using change editor.
> Line01 |A
> Line02 |B
> Line03 |y
> Line04 |D
>
> it seems to be done successfully, but this shelf can't be unshelved correctly.
> Result of unshelve is
> Line01 |A
> Line02 |<<<<<<<
> Line03 |B
> Line04 |<<<<<<< TREE
> Line05 |y
> Line06 |=======
> Line07 |C
> Line08 |=======
> Line09 |x
> Line10 |y
> Line11 |>>>>>>>
> Line12 |>>>>>>> MERGE-SOURCE
> Line13 |D

You are shelving a change that conflicts with your working tree. It will
be checked out with a conflict. I don't think this is a bug.

Specifically create a file ABCD. Edit the file to AByD. Shelve that
change. Edit the file to AxCD. Unshelve, and you will get a conflict.

This is the same behavior as merge.

bzr init A
echo -e "A\nB\nC\nD\n" > A/foo
bzr add A
bzr commit -m "ABCD" A
bzr branch A B
echo -e "A\nB\ny\nD\n" > A/foo
bzr commit -m "AByD" A
echo -e "A\nx\nC\nD\n" > B/foo
bzr commit -m "AxCD" B
cd B
bzr merge ../A # Conflicts in the same way

This is intentional behavior. If you edit lines that "touch" eachother,
you get a merge conflict, because we can't cleanly tell that those are
not meant to overlap.

 status: Invalid
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3Q1Y8ACgkQJdeBCYSNAAO4UwCgq6WF7fnXpEA9mxtUrM2F3u8L
HsUAn3MsFSG3rGejjirshl0X7JnEY1zX
=ThxZ
-----END PGP SIGNATURE-----

Changed in bzr:
status: New → Invalid
Revision history for this message
Martin Pool (mbp) wrote :

That conflict display does look a bit unclear though; I wonder if we
could make it better.

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote : Re: shelve : Failed to unshelve changes which was made by partial hunk shelving.

I agree with you that unshelve should make conflict in this case.

The result of steps you said is:
  Line 01 |A
  Line 02 |<<<<<<< TREE
  Line 03 |x
  Line 04 |C
  Line 05 |=======
  Line 06 |B
  Line 07 |y
  Line 08 |>>>>>>> MERGE-SOURCE
  Line 09 |D

I think this is natural result, but in this case, the result is more strange.

One more case.
If I revert this file after shelve, and then unshelve, unshelve says 'All change applied successfully'.
And result is:
  Line 01 |A
  Line 02 |<<<<<<<
  Line 03 |B
  Line 04 |C
  Line 05 |=======
  Line 06 |x
  Line 07 |y
  Line 08 |>>>>>>>
  Line 09 |D

Martin Pool (mbp)
summary: - shelve : Failed to unshelve changes which was made by partial hunk
- shelving.
+ bad conflict indication on unshelving partial shelve
Changed in bzr:
importance: Undecided → Medium
status: Invalid → Confirmed
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → High
importance: High → Low
tags: added: shelf
removed: check-for-breezy
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.