[RFC] X.Y.Z dotted revnos

John Arbash Meinel john at arbash-meinel.com
Wed Jan 9 21:15:54 GMT 2008


Attached is a possible patch to our dotted revision number generator.
It isn't suitable for merging, because I have to track down all of the
tests that expected our old style numbers. For now, I'm going with
option "C'" from my previous email. Specifically, the numbering looks like:

   A1
    |\
   B2 C1.1.1 -------.
    | |      \       \
   D3 E1.1.2  F1.2.1  M1.4.1
    |/       /  |     |
   G4 H1.2.2  I1.3.1  N1.4.2
    |/       /        |
   J5 K1.3.2          O1.5.3
    |/               /
   L6 ,-------------'
    |/
   P7

I decided that B was weird, because it was inconsistent between how it
numbered sub-branches versus main branches.

For revisions which only have 2 children (one regular, and one
'branch'), the numbering doesn't change. You still get 1.1.1, 1.1.2,
etc. The only thing that changes is when you get nested branches.

Here is an example of where it changes things:

OLD:
------------------------------------------------------------
revno: 2306
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-03-01 03:19:00 +0000
message:
  fix pull --overwrite, especially with bundles
    ------------------------------------------------------------
    revno: 1551.2.49.1.40.1.22.1.42.1.31.1.23
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Wed 2007-02-28 21:53:37 -0500
    message:
      Update test case per review
    ------------------------------------------------------------
    revno: 1551.2.49.1.40.1.22.1.42.1.31.1.22
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: Aaron's mergeable stuff
    timestamp: Wed 2007-02-28 16:32:55 -0500
    message:
      Fix pull --overwrite for bundles
    ------------------------------------------------------------
    revno: 1551.2.49.1.40.1.22.1.42.1.31.1.21
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Thu 2007-02-15 19:18:18 -0500
    message:
      Merge from bzr.dev

NEW:
------------------------------------------------------------
revno: 2306
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-03-01 03:19:00 +0000
message:
  fix pull --overwrite, especially with bundles
    ------------------------------------------------------------
    revno: 1551.10.23
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Wed 2007-02-28 21:53:37 -0500
    message:
      Update test case per review
    ------------------------------------------------------------
    revno: 1551.10.22
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: Aaron's mergeable stuff
    timestamp: Wed 2007-02-28 16:32:55 -0500
    message:
      Fix pull --overwrite for bundles
    ------------------------------------------------------------
    revno: 1551.10.21
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Thu 2007-02-15 19:18:18 -0500
    message:
      Merge from bzr.dev


I certainly feel like 1551.10.23 is easier to use as a handle than
1551.2.49.1.40.1.22.1.42.1.31.1.23.

It is trivial to change this numbering into "C":
   A1
    |\
   B2 C1.1.2 -------.
    | |      \       \
   D3 E1.1.3  F1.2.3  M1.4.3
    |/       /  |     |
   G4 H1.2.4  I1.3.4  N1.4.4
    |/       /        |
   J5 K1.3.5          O1.5.5
    |/               /
   L6 ,-------------'
    |/
   P7

So that the last digit is the nodes left-hand distance to null:. (Also
known as the 'revno' if that were the branch tip.)

This is what it would look like:

------------------------------------------------------------
revno: 2306
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-03-01 03:19:00 +0000
message:
  fix pull --overwrite, especially with bundles
    ------------------------------------------------------------
    revno: 1551.10.1758
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Wed 2007-02-28 21:53:37 -0500
    message:
      Update test case per review
    ------------------------------------------------------------
    revno: 1551.10.1757
    committer: Aaron Bentley <abentley at panoramicfeedback.com>
    branch nick: Aaron's mergeable stuff
    timestamp: Wed 2007-02-28 16:32:55 -0500
    message:
      Fix pull --overwrite for bundles
    ------------------------------------------------------------
    revno: 1551.10.1756
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: Aaron's mergeable stuff
    timestamp: Thu 2007-02-15 19:18:18 -0500
    message:
      Merge from bzr.dev


I find these harder to follow, something about
BIG_NUM.SMALL_NUM.BIG_NUM. I kind of like the feature that if I merge
someone else's branch revno 1000, then it shows up as X.Y.1000 in my
'bzr log'.

So at the moment I'm ambivalent, but leaning towards the simpler 'start
at 1 on new branch' form.

John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dotted_revnos.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080109/31768d00/attachment-0001.diff 


More information about the bazaar mailing list