[MERGE/RFC] Add dotted-decimal revision numbers to merge_sorted output
John Arbash Meinel
john at arbash-meinel.com
Thu Sep 7 04:22:09 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> Robert Collins wrote:
>>> Hi,
>>> This patch adds dotted decimal revision numbers to the output of
>>> merge_sorted. I haven't profiled it carefully, but it should be
>>> low-overhead. I've kept compatability, but we might want to just make it
>>> always do this and deprecate getting output without the revision
>>> numbers.
>>>
>>> The revision numbers are assigned like CVS:
>>>
>>> For a revision with number X, each child of X gets a revision number of
>>> X.SEQUENCE.1. IFF SEQUENCE is 0, then the childs revision number becomes
>>> X[:-1] + (X[-1] + 1) instead, which is what gives us the mainline.
>
> Sorry if I'm being thick, but this explanation doesn't make anything
> clear to me. How is SEQUENCE calculated? Is X an integer? If so, what
> does X[:-1] mean? Are these values stable as new children of X are
> discovered?
>
> Aaron
I agree he wasn't very clear. He and I discussed it on IRC, and the idea
is to get numbers like:
1
2
3
3.1.1
3.1.2
3.2.1
3.2.2
3.2.2.1.1
4
Just depending on what depth the branches are, and how many siblings it
might have. For example:
A-,
|\ \
B C \
| |\ \
D E F G
|/ | |
H I |
| / |
J / /
|/ /
K /
|/
L
- From the perspective of K, you get: (assuming left hand is leftmost
parent)
A 1
B 2
D 3
H 4
J 5
K 6
L 7
C 1.1.1
E 1.1.2
F 1.1.1.1.1
G 1.2.1
I 1.1.1.1.2
At least, I think I did that right. G is 1.2.1 because it is the first
revision of the second independent branch from revno 1.
F starts looking a little ugly, since it is the first revision of the
first branch off of the first branch of revno 1.
I like the revnos, I haven't fully reviewed the patch.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFE/5BhJdeBCYSNAAMRAqJiAJ4vI+nGayIZN/iaFzkKGZ8TjIL15gCfeDny
G9xP2T/mWUVX0YijvHXQ2JM=
=dZey
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list