revision spec for directly referring to svn changeset numbers

Bug #160605 reported by nicholas a. evans
2
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Wishlist
Jelmer Vernooij

Bug Description

It would be very useful to have a revision spec for directly referring to svn changeset numbers.

For example: "svn:29742" could be translated to
revision-id:svn-v3-trunk1:0487d25d-142b-0410-8fcf-b82ac621bf97:foobarproject%2Ftrunk:29742
anywhere that revision specs are used.

Revision history for this message
nicholas a. evans (nevans) wrote :

along with this, it would be very useful to have a --show-svn-ids option for bzr log.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Doing the latter would be a bit harder, and would require changes to core bzr.

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
assignee: nobody → jelmer
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Simple implemtation (svn:revno) now supported . This only works on the bzr branch itself, not on any Bazaar copies created from it - supporting the latter would require a bzr-svn mapping bump.

Changed in bzr-svn:
status: Triaged → Fix Committed
Revision history for this message
nicholas a. evans (nevans) wrote :

I'm getting an error with this when I use it from within my bzr checkout. Is there some way of knowing whether or not my bzr branch is the "branch itself" or a "copy created from it"? (I'm not sure that I understand the distinction anyway.)

~/src/mdlogix/imrs/trunk $ bzr info | grep 'checkout of'
        checkout of branch: svn+https://svn.mycompany.com/projectname/trunk
~/src/projectname/trunk $ bzr log -r 2012 --show-ids --short | head -2
 2012 mdotterer 2007-11-13
      revision-id:svn-v3-trunk1:0487d25d-142b-0410-8fcf-b82ac621bf97:imrs%2Ftrunk:30780
~/src/projectname/trunk $ bzr log -r svn:30780
bzr: ERROR: exceptions.AttributeError: 'BzrBranch6' object has no attribute 'generate_revision_id'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 768, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1702, in run
    rev1 = rev2 = revision[0].in_history(b)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 225, in in_history
    return self._match_on_and_check(branch, revs)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 207, in _match_on_and_check
    info = self._match_on(branch, revs)
  File "/home/nevans/.bazaar/plugins/svn/revspec.py", line 29, in _match_on
    return RevisionInfo.from_revision_id(branch, branch.generate_revision_id(int(self.spec[loc+1:])), branch.revision_history())
AttributeError: 'BzrBranch6' object has no attribute 'generate_revision_id'

bzr 0.92.0.candidate.1 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'log', '-r', 'svn:30780']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [0.92.0]
  gtk /home/nevans/.bazaar/plugins/gtk [0.93.0dev0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
  rebase /home/nevans/.bazaar/plugins/rebase [0.3.0dev0]
  svn /home/nevans/.bazaar/plugins/svn [0.4.5dev0]
  vimdiff /home/nevans/.bazaar/plugins/vimdiff [unknown]

** Please send this report to <email address hidden>
   with a description of what you were doing when the
   error occurred.

Thanks!

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

You can only use this on a Subversion branch, I'm afraid. A copy of a
Subversion branch doesn't contain the necessary information - and may
contain revisions from more than one Subversion repository, thus making
"svn:X" ambiguous.

This can be fixed, but would require a version bump of the bzr-svn mappings,
and so won't happen at least until 0.5.

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
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.