bzr status should not ignore all other command line arguments when passed a non-existent file

Bug #306394 reported by dann
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Karl Fogel

Bug Description

Assume that bar and baz are registered under bzr, foo is not.

Running the command below (-v -S is what emacs uses for the vc-dir command):

bzr status -v -S foo bar baz

results in:

bzr: ERROR: Path(s) do not exist: foo

nothing is shown about the other 2 files.
The other arguments should not be just ignored, their status is still useful.
If more that one file does is not registered, printing a
bzr: ERROR: Path(s) do not exist:
line for each one is fine.

This type of operation occurs in normal usage in emacs when using the vc-dir GUI.

Revision history for this message
Karl Fogel (kfogel) wrote :

I believe this is fixed now:

   $ bzr --version
   Bazaar (bzr) 1.11dev
     from bzr checkout /home/kfogel/src/bzr/bzr.dev
       revision: 3828
       revid: <email address hidden>
       branch nick: bzr.dev
     Python interpreter: /usr/bin/X11/python 2.5.2
     Python standard library: /usr/lib/python2.5
     bzrlib: /home/kfogel/src/bzr/bzr.dev/bzrlib
     Bazaar configuration: /home/kfogel/.bazaar
     Bazaar log file: /home/kfogel/.bzr.log

   Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
   http://bazaar-vcs.org/

   bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
   you may use, modify and redistribute it under the terms of the GNU
   General Public License version 2 or later.

   $ bzr info
   Standalone tree (format: pack-0.92)
   Location:
     branch root: .

   Related branches:
     parent branch: http://bazaar-vcs.org/bzr/bzr.dev/
   $ touch unversioned_file
   $ echo "Trivial modification." >> README
   $ echo "Trivial modification." >> TODO
   $ bzr status -v -S unversioned_file README TODO
    M README
    M TODO
   ? unversioned_file
   $ # Changing the input order doesn't affect the output order:
   $ bzr status -v -S README TODO unversioned_file
    M README
    M TODO
   ? unversioned_file
   $ bzr revert README TODO
    M README
    M TODO
   $ bzr status -v -S unversioned_file README TODO
   ? unversioned_file
   $

Revision history for this message
Karl Fogel (kfogel) wrote :

Noting that the fix is committed.

Changed in bzr:
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Fix Committed → Fix Released
Revision history for this message
dann (dann-ics) wrote : Re: [Bug 306394] Re: bzr status should not ignore all other command line arguments if when passing non-existent file

Karl Fogel <email address hidden> writes:

  > I believe this is fixed now:
  >
  > $ bzr --version
  > Bazaar (bzr) 1.11dev
  > from bzr checkout /home/kfogel/src/bzr/bzr.dev
  > revision: 3828
  > revid: <email address hidden>
  > branch nick: bzr.dev
  > Python interpreter: /usr/bin/X11/python 2.5.2
  > Python standard library: /usr/lib/python2.5
  > bzrlib: /home/kfogel/src/bzr/bzr.dev/bzrlib
  > Bazaar configuration: /home/kfogel/.bazaar
  > Bazaar log file: /home/kfogel/.bzr.log
  >
  > Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
  > http://bazaar-vcs.org/
  >
  > bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
  > you may use, modify and redistribute it under the terms of the GNU
  > General Public License version 2 or later.
  >
  > $ bzr info
  > Standalone tree (format: pack-0.92)
  > Location:
  > branch root: .
  >
  > Related branches:
  > parent branch: http://bazaar-vcs.org/bzr/bzr.dev/
  > $ touch unversioned_file

There's a misunderstanding here, this is not the point of this bug report!!

This is about non existent files.

The problem is what happens if you do this:

/bin/rm -f BLAH BLAH_BLAH
bzr status -v -S BLAH BLAH_BLAH unversioned_file README TODO

Revision history for this message
Karl Fogel (kfogel) wrote : Re: bzr status should not ignore all other command line arguments if when passing non-existent file

Sorry, my bad, I misread. The bug is still present. Changing status to 'confirmed', and here's a transcript:

   $ bzr --version
   Bazaar (bzr) 1.11dev
     from bzr checkout /home/kfogel/src/bzr/bzr.dev
       revision: 3828
       revid: <email address hidden>
       branch nick: bzr.dev
     Python interpreter: /usr/bin/X11/python 2.5.2
     Python standard library: /usr/lib/python2.5
     bzrlib: /home/kfogel/src/bzr/bzr.dev/bzrlib
     Bazaar configuration: /home/kfogel/.bazaar
     Bazaar log file: /home/kfogel/.bzr.log

   Copyright 2005, 2006, 2007, 2008 Canonical Ltd.
   http://bazaar-vcs.org/

   bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
   you may use, modify and redistribute it under the terms of the GNU
   General Public License version 2 or later.

   $ bzr st -v -S README TODO
   $ bzr st -v -S nonexistent_file README TODO
   bzr: ERROR: Path(s) do not exist: nonexistent_file
   You have new mail in /var/mail/kfogel
   $ echo "small mod" >> README
   $ echo "small mod" >> TODO
   $ bzr st -v -S README TODO
    M README
    M TODO
   $ bzr st -v -S nonexistent_file README TODO
   bzr: ERROR: Path(s) do not exist: nonexistent_file
   $

Revision history for this message
Karl Fogel (kfogel) wrote :

Status => 'Confirmed'

Changed in bzr:
status: Fix Released → Confirmed
Revision history for this message
Karl Fogel (kfogel) wrote :

Working on a fix.

Changed in bzr:
assignee: nobody → kfogel
Revision history for this message
Karl Fogel (kfogel) wrote : [RFC] Fixing bug #306394: status should tolerate nonexistent file.

I'm working on bug #306394 ("bzr status should not ignore all other
command line arguments when passed a non-existent file").

The basic fix is here (review welcome!):

   http://bazaar.launchpad.net/~kfogel/bzr/306394-status-tolerate-nonexistent/revision/3910

Re regression test: in bzrlib/tests/blackbox/test_status.py I see
test_status_nonexistent_file(), which looks for the current behavior:

    def test_status_nonexistent_file(self):
        # files that don't exist in either the basis tree or working tree
        # should give an error
        wt = self.make_branch_and_tree('.')
        out, err = self.run_bzr('status does-not-exist', retcode=3)
        self.assertContainsRe(err, r'do not exist.*does-not-exist')

Does that test mean that the current behavior is desirable for some
reason, and should not be considered a bug? Otherwise, I'll simply
adjust this test to expect a non-fatal warning instead of an error.

Or if the current behavior (fatal error) is desirable, then we should
probably close the bug as invalid.

Thanks,
-Karl

Revision history for this message
Karl Fogel (kfogel) wrote :

I've posted a [MERGE] request:

   https://lists.ubuntu.com/archives/bazaar/2008q4/051012.html

And BundleBuggy seems to have noticed it:

   https://lists.ubuntu.com/archives/bazaar/2008q4/051013.html

(If I had CC'd "306384{_AT_}bugs.launchpad.net" on my [MERGE] mail, I wouldn't have to be typing this manually, right?)

Revision history for this message
Karl Fogel (kfogel) wrote :

Current status: almost done.

Ian Clatworthy has reviewed the change itself and approves of the new UI, but points out a few other things that also need to be done for this to be merged: blackbox tests, status-flags update, and NEWS update. See https://lists.ubuntu.com/archives/bazaar/2009q1/051833.html .

Revision history for this message
Karl Fogel (kfogel) wrote :

Ian merged the change.

Changed in bzr:
status: Confirmed → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 1.12rc1
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.