bzr update on missing file does nothing. svn update brings back file.

Bug #191466 reported by illume
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
John C Barstow

Bug Description

hello,

If there is a file that is version controlled, then I delete it (say with rm on linux), then I want to get the version controlled version back.

bzr update missing_file does nothing.

Whereas I'm used to using svn, where update missing_file brings back file.

I think bzr update returning missing files makes sense, and is commonly used by svn people.

cheers,

Tags: doc

Related branches

Revision history for this message
Andrew Bennetts (spiv) wrote :

Did you try "bzr revert missing_file"? I believe "svn revert missing_file" also works when using Subversion, so I'd expect svn people to know to try that.

"bzr update" doesn't operate on single files. It applies any missing changes from the branch to your working tree, while preserving as much as possible any changes you've made locally.

I think "bzr update missing_file" could give a less misleading message, but the behaviour is by design. Probably this bug should be marked invalid.

Revision history for this message
illume (illume) wrote :

Hello,

Yes I eventually tried bzr revert after asking someone how to update my file. svn revert missing_file does indeed work.

I mostly use the commands update, commit, and add. I find with svn I can get away with 99% of operations with those three commands without having to consult help.

Making update act more like svn for missing files does a few of things:
1)- makes it more familiar for svn users.
2)- requires one less command to be memorized.
3)- updates the "tree to have the latest code committed to its branch".

By not updating the tree to have the latest code committed to the branch, I think bzr update is buggy - because the tree is missing files.

I guess it's different behavior is valid - just different to svn. I think the difference should at least be documented, and to improve the ui - at least a message explaining how to update the file should be printed. Perhaps a message saying that the file has been removed locally, and letting them know how to get the current version back.

"bzr update missing_file" has one commonly expected behavior of updating the file - which bzr currently doesn't account for.

Update takes an optional second argument (currently just a directory). I think it should also apply to files for the reasons above.

cheers,

This is the help for bzr update for reference:
"""
bzr --help update
Purpose: Update a tree to have the latest code committed to its branch.
Usage: bzr update [DIR]

Options:
  -v, --verbose Display more information.
  -q, --quiet Only display errors and warnings.
  -h, --help Show help message.

Description:
  This will perform a merge into the working tree, and may generate
  conflicts. If you have any local changes, you will still
  need to commit them after the update for the update to be complete.

  If you want to discard your local changes, you can just do a
  'bzr revert' instead of 'bzr commit' after the update.
"""

Revision history for this message
Aaron Bentley (abentley) wrote :

The functionality requested is already provided via revert.
The functionality requested is fundamentally incompatible with what bazaar update is supposed to do, which is apply upstream changes while leaving your local changes, such as file deletion, intact.

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

It's not a code bug, however since it is something people might expect coming from cvs or svn it would be good to make sure this is clear in the docs.

Changed in bzr:
assignee: nobody → matthew.revell
importance: Undecided → Low
status: Invalid → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

This may be a doc-only fix. But I think it is actually born from a bad representation in CVS which SVN then preserved. The only way to revert your files to pristine from CVS was "rm foo; cvs update foo".

I really don't want to introduce that design flaw in bzr, but we might be clearer about what the command is supposed to be doing.

Revision history for this message
Matthew Revell (matthew.revell) wrote :

Unassigning as I'm not working on bazaar at present.

Changed in bzr:
assignee: matthew.revell → nobody
John C Barstow (jbowtie)
Changed in bzr:
assignee: nobody → John C Barstow (jbowtie)
Andrew Bennetts (spiv)
Changed in bzr:
milestone: none → 2.3b1
status: Confirmed → Fix Released
Revision history for this message
Roel Van de Paar (roel11) wrote :
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.