push should warn about uncommitted changes

Bug #284038 reported by Martin Owens on 2008-10-15
Affects Status Importance Assigned to Milestone
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.

Related branches

Martin Pool (mbp) on 2008-10-15
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Martin Pool (mbp) on 2008-10-26
description: updated
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).

Martin Pool (mbp) wrote :

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

Vincent Ladeuil (vila) on 2009-05-18
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila) on 2009-06-10
Changed in bzr:
milestone: none → 1.16
status: Confirmed → Fix Committed
Jonathan Lange (jml) wrote :

This didn't quite make it into 1.16rc1.

Changed in bzr:
milestone: 1.16 → none
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?

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
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

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:


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


Vincent Ladeuil (vila) on 2009-06-29
Changed in bzr:
status: In Progress → Fix Committed
Vincent Ladeuil (vila) on 2009-06-30
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers