[PATCH 3 of 3 cg3 v2] changegroups: add documentation for cg3

Augie Fackler raf at durin42.com
Fri Dec 18 09:13:39 CST 2015


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1450450655 18000
#      Fri Dec 18 09:57:35 2015 -0500
# Node ID 50d139249b209b5ef630c0be827ae89858f9197c
# Parent  a01c9a068990ef23d5edb910620753179ea28379
# EXP-Topic cg3
changegroups: add documentation for cg3

diff --git a/mercurial/help/internals/changegroups.txt b/mercurial/help/internals/changegroups.txt
--- a/mercurial/help/internals/changegroups.txt
+++ b/mercurial/help/internals/changegroups.txt
@@ -4,9 +4,11 @@ Changegroups
 Changegroups are representations of repository revlog data, specifically
 the changelog, manifest, and filelogs.
 
-There are 2 versions of changegroups: ``1`` and ``2``. From a
-high-level, they are almost exactly the same, with the only difference
-being a header on entries in the changeset segment.
+There are 3 versions of changegroups: ``1``, ``2``, and ``3``. From a
+high-level, versions ``1`` and ``2`` are almost exactly the same, with
+the only difference being a header on entries in the changeset
+segment. Version ``3`` adds support for exchanging treemanifests and
+includes revlog flags in the delta header.
 
 Changegroups consists of 3 logical segments::
 
@@ -60,8 +62,8 @@ Each *chunk*'s data consists of the foll
 The *length* field is the byte length of the remaining 3 logical pieces
 of data. The *delta* is a diff from an existing entry in the changelog.
 
-The *delta header* is different between versions ``1`` and ``2`` of the
-changegroup format.
+The *delta header* is different between versions ``1``, ``2``, and
+``3`` of the changegroup format.
 
 Version 1::
 
@@ -81,6 +83,15 @@ Version 2::
    |            |             |             |            |            |
    +------------------------------------------------------------------+
 
+Version 3::
+
+   +------------------------------------------------------------------------------+
+   |            |             |             |            |            |           |
+   |    node    |   p1 node   |   p2 node   | base node  | link node  | flags     |
+   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
+   |            |             |             |            |            |           |
+   +------------------------------------------------------------------------------+
+
 The *mdiff header* consists of 3 32-bit big-endian signed integers
 describing offsets at which to apply the following delta content::
 
@@ -125,6 +136,10 @@ corresponding to an individual file whos
    |          |          |          |     |
    +--------------------------------------+
 
+In version ``3`` of the changegroup format, filelogs may include
+directory logs when treemanifests are in use. directory logs are
+identified by having a trailing '/' on their filename (see below).
+
 The final filelog sub-segment is followed by an *empty chunk* to denote
 the end of the segment and the overall changegroup.
 
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -883,9 +883,11 @@ sub-topics can be accessed
       Changegroups are representations of repository revlog data, specifically
       the changelog, manifest, and filelogs.
   
-      There are 2 versions of changegroups: "1" and "2". From a high-level, they
-      are almost exactly the same, with the only difference being a header on
-      entries in the changeset segment.
+      There are 3 versions of changegroups: "1", "2", and "3". From a high-
+      level, versions "1" and "2" are almost exactly the same, with the only
+      difference being a header on entries in the changeset segment. Version "3"
+      adds support for exchanging treemanifests and includes revlog flags in the
+      delta header.
   
       Changegroups consists of 3 logical segments:
   
@@ -939,7 +941,7 @@ sub-topics can be accessed
       The *length* field is the byte length of the remaining 3 logical pieces of
       data. The *delta* is a diff from an existing entry in the changelog.
   
-      The *delta header* is different between versions "1" and "2" of the
+      The *delta header* is different between versions "1", "2", and "3" of the
       changegroup format.
   
       Version 1:
@@ -960,6 +962,15 @@ sub-topics can be accessed
         |            |             |             |            |            |
         +------------------------------------------------------------------+
   
+      Version 3:
+  
+        +------------------------------------------------------------------------------+
+        |            |             |             |            |            |           |
+        |    node    |   p1 node   |   p2 node   | base node  | link node  | flags     |
+        | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
+        |            |             |             |            |            |           |
+        +------------------------------------------------------------------------------+
+  
       The *mdiff header* consists of 3 32-bit big-endian signed integers
       describing offsets at which to apply the following delta content:
   
@@ -1004,6 +1015,10 @@ sub-topics can be accessed
         |          |          |          |     |
         +--------------------------------------+
   
+      In version "3" of the changegroup format, filelogs may include directory
+      logs when treemanifests are in use. directory logs are identified by
+      having a trailing '/' on their filename (see below).
+  
       The final filelog sub-segment is followed by an *empty chunk* to denote
       the end of the segment and the overall changegroup.
   


More information about the Mercurial-devel mailing list