push should warn about uncommitted changes

Bug #284038 reported by Martin Owens
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Vincent Ladeuil

Bug Description

It would be nice if bzr gave a warning when you have changes that have not been committed AND there are no revisions to push.

Thus people would be reminded to commit their code and not just blindly push and wonder where their files have gone.

This should also check for pending merges.

On very large trees checking for changes may take a slightly noticeable time so it may be desirable to have an option to avoid doing that check. On the other hand some users may prefer an error rather than a warning. So perhaps a tri-state option would be appropriate.

Tags: easy mysql ui

Related branches

Martin Pool (mbp)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Martin Pool (mbp)
description: updated
Revision history for this message
Vincent Ladeuil (vila) wrote :

I think that people that needs this safeguard wont notice if they have revisions to push (in addition to the uncommitted changes in the tree).

Since the tree check is not cheap, we don't want it to be done by default either.

I think the best solution is to add a --strict option to the push command (defaulting to false).
If not specified on the command line, we can additionally check a configuration variable so that people can opt-in either from bazaar.conf, locations.conf or branch.conf (to ease deployment since the original use case is more about a team policy than an isolated user problem).

Revision history for this message
Martin Pool (mbp) wrote :

The strict option makes sense to me. It might be worth checking with Guilhem.

Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 1.16
status: Confirmed → Fix Committed
Revision history for this message
Jonathan Lange (jml) wrote :

This didn't quite make it into 1.16rc1.

Changed in bzr:
milestone: 1.16 → none
Revision history for this message
Martin Pool (mbp) wrote :

It looks like this is landed for 1.17?

Does this also fix bug 322808, asking for push to check for pending merges?

Revision history for this message
Martin Pool (mbp) wrote :

This seems to now be in trunk for 1.17, please change the status back if more needs to be done.

Changed in bzr:
milestone: none → 1.17
status: Fix Committed → Fix Released
Revision history for this message
Vincent Ladeuil (vila) wrote :

I need to add the pending merges check and make --strict the default behavior.

Changed in bzr:
status: Fix Released → In Progress
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 284038] Re: push should warn about uncommitted changes

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

Vincent Ladeuil wrote:
> I need to add the pending merges check and make --strict the default
> behavior.
>
> ** Changed in: bzr
> Status: Fix Released => In Progress
>

It is pretty simple:

if len(wt.get_parent_ids) > 1:

John
=:->

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

iEYEARECAAYFAkpFFt8ACgkQJdeBCYSNAAPl2gCfeg45LkndmXe+zqcuDa5cJJHP
OCkAmgJQXIPKZx2y8byTUSt20iRDyY2O
=ot+t
-----END PGP SIGNATURE-----

Vincent Ladeuil (vila)
Changed in bzr:
status: In Progress → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
status: Fix Committed → Fix Released
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.