-r date:today raises an unhandled exception when there have been no commit today.

Bug #52859 reported by Matthieu Moy
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
John A Meinel

Bug Description

See traceback below.

I suppose the fix is just to catch the exception and provide a clean error message.

$ bzr log -r date:yesterday..date:today
bzr: ERROR: bzrlib.errors.NoSuchRevision: Branch BzrBranch5('file:///home/moy/iisc/simul
ator/') has no revision date:today

Traceback (most recent call last):
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/commands.py", line 694, in run_bzr_ca
tch_errors
    return run_bzr(argv)
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/commands.py", line 656, in run_bzr
    ret = run(*run_argv)
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/commands.py", line 281, in run_argv_a
liases
    return self.run(**all_cmd_args)
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/commands.py", line 666, in ignore_pip
e
    result = func(*args, **kwargs)
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/builtins.py", line 1324, in run
    rev2 = revision[1].in_history(b).revno
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/revisionspec.py", line 156, in in_his
tory
    return self._match_on_and_check(branch, revs)
  File "/home/moy/local/usr/src/bzr/bzr.moy/bzrlib/revisionspec.py", line 147, in _match
_on_and_check
    raise NoSuchRevision(branch, self.prefix + str(self.spec))
NoSuchRevision: Branch BzrBranch5('file:///home/moy/iisc/simulator/') has no revision da
te:today

bzr 0.9.0dev0 on python 2.4.4.candidate.0 (linux2)
arguments: ['/home/moy/bin/local/moy/bzr', 'log', '-r', 'date:yesterday..date:today']

** please send this report to <email address hidden>

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

In general, when a revision spec tries to match, it should give a nice looking error if it cannot.

The problem is re-use of the 'NoSuchRevision' error. Which in some instances is a real bug, in others, (such as this) it was a simple invalid request. This is where we could set 'e.user_error=True', or just have a different exception for RevisionSpec.

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

This has been fixed along with other RevisionSpec related bugs. The errors are now:
liliana % bzr log -r date:today
bzr: ERROR: Requested revision: 'date:today' does not exist in branch:
BzrBranch5('file:///home/jameinel/dev/bzr/0.10-working/no-knit-hash-prefix/')

Changed in bzr:
assignee: nobody → jameinel
status: Confirmed → Fix Released
Revision history for this message
Matthieu Moy (matthieu-moy) wrote : Re: [Bug 52859] Re: -r date:today raises an unhandled exception when there have been no commit today.

John A Meinel <email address hidden> writes:

> bzr: ERROR: Requested revision: 'date:today' does not exist in branch:
> BzrBranch5('file:///home/jameinel/dev/bzr/0.10-working/no-knit-hash-prefix/')

Is it intentional that the name of objects appear in the
user-interface?

--
Matthieu

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.