_expand_annotations should make it easier to annotate working tree with uncommitted changes

Bug #606465 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

bzr annotate can annotate the working tree, but apparently it need you to make up a synthetic revision for the uncommitted changes. bzr-gtk has this:

        current_revision = FakeRevision(CURRENT_REVISION)
        current_revision.committer = self.branch.get_config().username()
        current_revision.timestamp = time.time()
        current_revision.message = '[Not yet committed]'
        current_revision.parent_ids = tree.get_parent_ids()
        current_revision.properties['branch-nick'] = self.branch._get_nick(local=True)
        current_revno = '%d?' % (self.branch.revno() + 1)

and something similar is reproduced in <https://code.edge.launchpad.net/~rom1-chal/bzr-builder/reporting_conflict_from_merge/+merge/30127>

Perhaps this is an unavoidable consequence of wanting to report as a revision something that's not a revision at all, but it's odd that the client code needs to do it.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 606465] [NEW] _expand_annotations should make it easier to annotate working tree with uncommitted changes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Public bug reported:
>
> bzr annotate can annotate the working tree, but apparently it need you
> to make up a synthetic revision for the uncommitted changes. bzr-gtk
> has this:
>
> current_revision = FakeRevision(CURRENT_REVISION)
> current_revision.committer = self.branch.get_config().username()
> current_revision.timestamp = time.time()
> current_revision.message = '[Not yet committed]'
> current_revision.parent_ids = tree.get_parent_ids()
> current_revision.properties['branch-nick'] = self.branch._get_nick(local=True)
> current_revno = '%d?' % (self.branch.revno() + 1)
>
> and something similar is reproduced in
> <https://code.edge.launchpad.net/~rom1-chal/bzr-
> builder/reporting_conflict_from_merge/+merge/30127>
>
> Perhaps this is an unavoidable consequence of wanting to report as a
> revision something that's not a revision at all, but it's odd that the
> client code needs to do it.
>
> ** Affects: bzr
> Importance: Wishlist
> Status: Confirmed
>
>
> ** Tags: annotate cleanup
>

Is this bzr or bzr-gtk?

My understanding is that _expand_annotations is setting the last
modified revision to CURRENT_REVISION, which seems reasonable (you want
to set it to *something*, None would be valid, but possibly reserved for
i-don't-know-yet.)

This seems more like something bzr-gtk needs to be able to give a point
in their presentation. (And a previous link to traverse to).

What would you suggest would be better?

I read some of the posted discussion between you and James, but that
looks more like "CurrentRevision" should just be auto-generated by bzr,
which seems a bit... iffy. Given that we use CURRENT_REVISION explicitly
to define a revision that isn't in the repository.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxBabIACgkQJdeBCYSNAAM/uQCfQRrQR9Q69LuilkshVV/UwR+W
AdkAoIWSDffA+NbkVtB0KzNnmUpckTNy
=ctiA
-----END PGP SIGNATURE-----

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.