bzr bisect should update the working copy rather than revert it

Bug #683816 reported by Xavier (Open ERP)
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar Bisect Plugin
New
Undecided
Gustaf Thorslund

Bug Description

Currently, bisect uses `revert` to set the working copy to the correct revision.

Since bzr 2.1, `update` can take a `—revision` argument. Using it (when available anyway) would have the advantages of leaving the working copy clean (better ability to try things out when reaching the result of the bisect) and of providing more informations to the user (if the user performs a lot of operations after the latest bisect call he might lose his way/bearings, `bzr revno —tree` gives the information of which revision is the current one at least) and the tools (`bzr qlog` for instance will mark the current working copy revision on the log).

Therefore, I believe it would be a better working mechanic for bisect than revert.

Changed in bzr-bisect:
assignee: nobody → Gustaf Thorslund (gthorslund)
Revision history for this message
Gustaf Thorslund (gthorslund) wrote :

I've actually thought about this too and done some coding. I'll look over my code and attach to the bug.

One thing I ran into was what to do with uncommitted changes. 'revert' would just throw them away while 'update' will try to move them away. Next update would move them again. Don't remember details now, but I ended up with lots of files being moved.

I think a good solution would be to refuse starting if there are uncommitted changes or even unknown files. That's also where I left when looking at this last time.

Revision history for this message
Max Bowsher (maxb) wrote :

Please do not refuse to start if there are uncommitted changes. A reasonable use case is to bisect for a bug location, whilst maintaining some local change needed to facilitate the testing. Rather, bzr-bisect should just update the working tree, and halt bisection if conflicts occur during an update.

Revision history for this message
Colin D Bennett (colinb) wrote :

I have found that the current behavior (ala "bzr revert -r N") causes all sorts of conflicts in some cases which has made bzr-bisect unusable for me so far. Instead, I manually perform the bisection with a series of "bzr update -r N" commands.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

> Please do not refuse to start if there are uncommitted changes.

That could be solved by refusing by default, providing a nice error message and accepting if bisect is started with a flag (such as —force) (e.g. "bisect has detected uncommitted changes in you working copy. These changes may conflict with the bisection process, it is recommended to shelve or revert them. If you want to bisect with your uncommitted changes applied, use the '—force' flag")

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 683816] Re: bzr bisect should update the working copy rather than revert it

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

On 5/11/2011 10:36 AM, Xavier (Open ERP) wrote:
>> Please do not refuse to start if there are uncommitted changes.
>
> That could be solved by refusing by default, providing a nice error
> message and accepting if bisect is started with a flag (such as —force)
> (e.g. "bisect has detected uncommitted changes in you working copy.
> These changes may conflict with the bisection process, it is recommended
> to shelve or revert them. If you want to bisect with your uncommitted
> changes applied, use the '—force' flag")
>

If we used "update -r N" then it leaves uncommitted changes in the tree,
which isn't a very accurate model for "bisect". Since you aren't
actually testing the content of that revision.

I don't see why 'revert -r N' would cause more conflicts, maybe
something with non-empty directories? If so, update would have the same
conflicts, IIRC.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3KadgACgkQJdeBCYSNAAPTdACaAymwNXl3cwbLtc/O9Tu51RDZ
gGoAn3/7CDJly0fkQm5EAFvRawCq/YYp
=j6Sv
-----END PGP SIGNATURE-----

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

> If we used "update -r N" then it leaves uncommitted changes in the tree, which isn't a very accurate model for "bisect". Since you aren't actually testing the content of that revision.

No, but as Colin notes this is useful if you need some bit of code to test your bisection e.g. you implemented a new method (or a new test) which exposes breakage, you want to bisect with that code in place otherwise you have to reapply it every time (which becomes annoying fast).

> I don't see why 'revert -r N' would cause more conflicts, maybe something with non-empty directories?

1. Are you sure the conflict resolution is the same?

2. The issue is that `bzr revert` is a dirty working copy, knowing what was applied before and what bazaar brought back due to revert is much more painful than doing so with update.

Revision history for this message
John A Meinel (jameinel) wrote :

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

On 5/11/2011 1:08 PM, Xavier (Open ERP) wrote:
>> If we used "update -r N" then it leaves uncommitted changes in the
> tree, which isn't a very accurate model for "bisect". Since you aren't
> actually testing the content of that revision.
>
> No, but as Colin notes this is useful if you need some bit of code to
> test your bisection e.g. you implemented a new method (or a new test)
> which exposes breakage, you want to bisect with that code in place
> otherwise you have to reapply it every time (which becomes annoying
> fast).
>
>> I don't see why 'revert -r N' would cause more conflicts, maybe
> something with non-empty directories?
>
> 1. Are you sure the conflict resolution is the same?
>
> 2. The issue is that `bzr revert` is a dirty working copy, knowing what
> was applied before and what bazaar brought back due to revert is much
> more painful than doing so with update.
>

You can always do "bzr status -r N" and "bzr diff -r N", which should be
fairly obvious.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3KkZQACgkQJdeBCYSNAAPEPgCgkJXXTQ1JsFbVROm2uX2tdiR1
ADsAn1SMyeqM0gTEnxdsxVGq7ZyjbXr+
=gGfd
-----END PGP SIGNATURE-----

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

It also requires keeping track of the current revision under bisection, poses significant risks when trying to partially revert or shelve these modifications and is overall automatable grunt work, perfect for computers to perform.

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.