Better handling of non-existent file argument

Bug #50793 reported by Francis J. Lacoste
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Cheuksan Edward Wang

Bug Description

bzr should report an error when it is given non-existing file arguments to its
command. Presently, it acts like if no argument was given which is kind of consusing.

For example,

bzr log no-such-file

will display the whole log information.

Same thing for,

bzr diff non-existent-file

This will display the diff for the whole tree.

The later is particulary confusing, because 'bzr status' report files using a path relative to the tree of the project.
So, when working in a large project, I do a bzr status in a subdirectory and then copy the path of the file reported as modified and use bzr diff on that, I get the diff of the whole tree. It took me a while to understand, that this was caused by the fact that the path I used were wrong. (Feel free to consider that a bug against bzr status also).

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

In the latest bzr.dev (at least by 1807), this has already been fixed for the diff and status commands. You now get:
$ bzr diff foo
bzr: ERROR: Path(s) are not versioned: foo
$ bzr status foo
bzr: ERROR: Path(s) do not exist: foo
$ touch foo
$ bzr status foo
unknown:
  foo

This is still broken for 'log', 'commit' and a few others, so I'll leave this bug open.
But it is better for a few things.

John

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

This would be nice to fix for 0.9, but it should not block it. (the bug existed in 0.8, so it isn't a regression)

Changed in bzr:
importance: Untriaged → Medium
status: Unconfirmed → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

'bzr diff' 'bzr add' and 'bzr status' have been fixed.
But 'bzr log' still acts like no file was given, and 'bzr commit' just gives:
bzr: ERROR: no changes to commit. use --unchanged to commit anyhow

Now, you get a real error if you don't supply a message:
liliana % bzr commit "a commit log which actually seems to be a file"
bzr: ERROR: Path(s) do not exist: "a commit log which actually seems to be a file"

So it seems we need more explicit handling of it for 'bzr commit'.

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

some of this is related to bug 51980

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

Aaron had some fixes for 'bzr commit', but we should audit other commands and make sure everything is working for 0.12.

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

marking it as fixed for most commands.

Changed in bzr:
status: Confirmed → Fix Released
Changed in bzr:
assignee: nobody → wang02139
Revision history for this message
Wouter van Heyst (larstiq) wrote :

merged in bzr.dev r2103

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.