log --revision date:yesterday and explicit date when only one commit matches broken.

Bug #1515934 reported by David I
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
New
Undecided
Unassigned

Bug Description

The revisionspec help says the following about the date signature:

<begin>
date:

    Supply a datestamp to select the first revision that matches the date.
    Date can be 'yesterday', 'today', 'tomorrow' or a YYYY-MM-DD string.
    Matches the first entry after a given date (either at midnight or
    at a specified time).

    One way to display all the changes since yesterday would be:

        bzr log -r date:yesterday..

    Examples:

      date:yesterday -> select the first revision since yesterday
      date:2006-08-14,17:10:14 -> select the first revision after
                                   August 14th, 2006 at 5:10pm.
<end>

However errors occur when I try to use this on a repos with the following last commits:
<begin>
$ bzr log -r revno:72.. file:///data/id/CmsRoot/repos/Bundles/dev_navinfo
------------------------------------------------------------
revno: 73 [merge]
committer: cmsadmin <email address hidden>
branch nick: dev_navinfo
timestamp: Fri 2015-11-13 10:19:31 +0100
message:
  Task: NICHN011479
  Integrating into repository
------------------------------------------------------------
revno: 72
tags: dev_navinfo_20151016, dev_navinfo_20151017
committer: cmsadmin <email address hidden>
branch nick: dev_navinfo
timestamp: Thu 2015-09-17 04:25:36 +0200
message:
  add 14.04 builds
------------------------------------------------------------
Use --include-merged or -n0 to see merged revisions.
<end>

Examples, note that the date when these were run was 2015-11-13, the date of the commit for revision 73:
<begin>
$ bzr log -r date:yesterday.. file:///data/id/CmsRoot/repos/Bundles/dev_navinfo
bzr: ERROR: Requested revision: 'date:yesterday' does not exist in branch: file:///data/id/CmsRoot/repos/Bundles/dev_navinfo/
<end>

Expected revno 73.

<begin>
bzr log -r date:2015-10-01.. -n0 file:///data/id/CmsRoot/repos/Bundles/dev_navinfo
bzr: ERROR: Requested revision: 'date:2015-10-01' does not exist in branch: file:///data/id/CmsRoot/repos/Bundles/dev_navinfo/
<end>

Expected revno 73.

<begin>
$ bzr log -r 2010-01-01..date:today -n0 file:///data/id/CmsRoot/repos/Bundles/dev_navinfo
bzr: ERROR: Requested revision: 'date:today' does not exist in branch: file:///data/id/CmsRoot/repos/Bundles/dev_navinfo/
<end>

Expected complete history.

I also wonder how 'tomorrow' can ever work given that the description says that the selection is for the 'first entry after a given date', e.g.

<begin>
$ bzr log -r ..date:tomorrow -n0 file:///data/id/CmsRoot/repos/Bundles/dev_navinfo
bzr: ERROR: Requested revision: 'date:tomorrow' does not exist in branch: file:///data/id/CmsRoot/repos/Bundles/dev_navinfo/
<end>

The bzr version used is:
<begin>
$ bzr --version
Bazaar (bzr) 2.6.0
  Python interpreter: /usr/bin/python 2.7.6
  Python standard library: /usr/lib/python2.7
  Platform: Linux-3.13.0-66-generic-x86_64-with-Ubuntu-14.04-trusty
  bzrlib: /data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib
  Bazaar configuration: /data/users/david.ingamells/.bazaar
  Bazaar log file: /data/users/david.ingamells/.bzr.log

Copyright 2005-2012 Canonical Ltd.
http://bazaar.canonical.com/

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.

Bazaar is part of the GNU Project to produce a free operating system.
<end>

Here are example tracebacks from the bzr log file:

<begin>
Fri 2015-11-13 10:56:08 +0100
0.081 bazaar version: 2.6.0
0.081 bzr arguments: [u'log', u'-r', u'2010-01-01..date:today', u'-n0', u'file:///data/id/CmsRoot/repos/Bundles/dev_navinfo']
0.087 looking for plugins in /data/users/david.ingamells/.bazaar/plugins
0.092 looking for plugins in /data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/plugins
0.097 Plugin name diff_revid already loaded
0.143 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.143 Plugin name po_merge already loaded
0.143 Plugin name bash_completion already loaded
0.143 Plugin name grep already loaded
0.143 Plugin name launchpad already loaded
0.143 Plugin name weave_fmt already loaded
0.143 Plugin name changelog_merge already loaded
0.143 Plugin name netrc_credential_store already loaded
0.143 Plugin name news_merge already loaded
0.151 Returning RevisionSpec RevisionSpec_date for date:today
0.152 encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'
0.244 Traceback (most recent call last):
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 1138, in ignore_pipe
    result = func(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/builtins.py", line 2794, in run
    revision, file_list, self.add_cleanup)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/log.py", line 2035, in _get_info_for_log_files
    "log")
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/builtins.py", line 2928, in _get_revision_range
    rev2 = end_spec.in_history(branch)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/revisionspec.py", line 233, in in_history
    return self._match_on_and_check(branch, revs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/revisionspec.py", line 201, in _match_on_and_check
    info = self._match_on(branch, revs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/revisionspec.py", line 747, in _match_on
    raise errors.InvalidRevisionSpec(self.user_spec, branch)
InvalidRevisionSpec: Requested revision: 'date:today' does not exist in branch: file:///data/id/CmsRoot/repos/Bundles/dev_navinfo/

0.244 return code 3

Fri 2015-11-13 10:56:18 +0100
0.072 bazaar version: 2.6.0
0.072 bzr arguments: [u'log', u'-r', u'2010-01-01..date:yesterday', u'-n0', u'file:///data/id/CmsRoot/repos/Bundles/dev_navinfo']
0.075 looking for plugins in /data/users/david.ingamells/.bazaar/plugins
0.085 looking for plugins in /data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/plugins
0.085 Plugin name diff_revid already loaded
0.115 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.115 Plugin name po_merge already loaded
0.115 Plugin name bash_completion already loaded
0.115 Plugin name grep already loaded
0.115 Plugin name launchpad already loaded
0.115 Plugin name weave_fmt already loaded
0.115 Plugin name changelog_merge already loaded
0.115 Plugin name netrc_credential_store already loaded
0.115 Plugin name news_merge already loaded
0.122 Returning RevisionSpec RevisionSpec_date for date:yesterday
0.123 encoding stdout as sys.stdout encoding 'ANSI_X3.4-1968'
0.196 Traceback (most recent call last):
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/commands.py", line 1138, in ignore_pipe
    result = func(*args, **kwargs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/builtins.py", line 2794, in run
    revision, file_list, self.add_cleanup)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/log.py", line 2035, in _get_info_for_log_files
    "log")
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/builtins.py", line 2928, in _get_revision_range
    rev2 = end_spec.in_history(branch)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/revisionspec.py", line 233, in in_history
    return self._match_on_and_check(branch, revs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/revisionspec.py", line 201, in _match_on_and_check
    info = self._match_on(branch, revs)
  File "/data/id/release/bzr/current/x86_64_Ubuntu_14.04/lib/python/bzrlib/revisionspec.py", line 747, in _match_on
    raise errors.InvalidRevisionSpec(self.user_spec, branch)
InvalidRevisionSpec: Requested revision: 'date:yesterday' does not exist in branch: file:///data/id/CmsRoot/repos/Bundles/dev_navinfo/
<end>

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.