D7883: nodemap: keep track of the ondisk id of nodemap blocks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

D7883: nodemap: keep track of the ondisk id of nodemap blocks

martinvonz (Martin von Zweigbergk)
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  If we are to incrementally update the files, we need to keep some details about
  the data we read.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7883

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -220,6 +220,11 @@
 
     contains up to 16 entry indexed from 0 to 15"""
 
+    def __init__(self):
+        super(Block, self).__init__()
+        # If this block exist on disk, here is its ID
+        self.ondisk_id = None
+
     def __iter__(self):
         return iter(self.get(i) for i in range(16))
 
@@ -330,8 +335,8 @@
     """Parse the serialization of an individual block
     """
     block = Block()
-    ondisk_id = len(block_map)
-    block_map[ondisk_id] = block
+    block.ondisk_id = len(block_map)
+    block_map[block.ondisk_id] = block
     values = S_BLOCK.unpack(block_data)
     for idx, v in enumerate(values):
         if v == NO_ENTRY:



To: marmoute, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D7883: nodemap: keep track of the ondisk id of nodemap blocks

martinvonz (Martin von Zweigbergk)
marmoute updated this revision to Diff 19764.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7883?vs=19301&id=19764

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7883/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7883

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -220,6 +220,11 @@
 
     contains up to 16 entry indexed from 0 to 15"""
 
+    def __init__(self):
+        super(Block, self).__init__()
+        # If this block exist on disk, here is its ID
+        self.ondisk_id = None
+
     def __iter__(self):
         return iter(self.get(i) for i in range(16))
 
@@ -327,8 +332,8 @@
     """Parse the persisted version of an individual block
     """
     block = Block()
-    ondisk_id = len(block_map)
-    block_map[ondisk_id] = block
+    block.ondisk_id = len(block_map)
+    block_map[block.ondisk_id] = block
     values = S_BLOCK.unpack(block_data)
     for idx, v in enumerate(values):
         if v == NO_ENTRY:



To: marmoute, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D7883: nodemap: keep track of the ondisk id of nodemap blocks

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
marmoute updated this revision to Diff 19792.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7883?vs=19764&id=19792

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7883/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7883

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -220,6 +220,11 @@
 
     contains up to 16 entry indexed from 0 to 15"""
 
+    def __init__(self):
+        super(Block, self).__init__()
+        # If this block exist on disk, here is its ID
+        self.ondisk_id = None
+
     def __iter__(self):
         return iter(self.get(i) for i in range(16))
 
@@ -328,8 +333,8 @@
     """Parse the persisted version of an individual block
     """
     block = Block()
-    ondisk_id = len(block_map)
-    block_map[ondisk_id] = block
+    block.ondisk_id = len(block_map)
+    block_map[block.ondisk_id] = block
     values = S_BLOCK.unpack(block_data)
     for idx, v in enumerate(values):
         if v == NO_ENTRY:



To: marmoute, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D7883: nodemap: keep track of the ondisk id of nodemap blocks

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
marmoute added a comment.
marmoute updated this revision to Diff 19836.


  small doc update on .#s[1]

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7883?vs=19792&id=19836

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7883/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7883

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -221,6 +221,11 @@
 
     contains up to 16 entry indexed from 0 to 15"""
 
+    def __init__(self):
+        super(Block, self).__init__()
+        # If this block exist on disk, here is its ID
+        self.ondisk_id = None
+
     def __iter__(self):
         return iter(self.get(i) for i in range(16))
 
@@ -329,8 +334,8 @@
     """Parse the persisted version of an individual block
     """
     block = Block()
-    ondisk_id = len(block_map)
-    block_map[ondisk_id] = block
+    block.ondisk_id = len(block_map)
+    block_map[block.ondisk_id] = block
     values = S_BLOCK.unpack(block_data)
     for idx, v in enumerate(values):
         if v == NO_ENTRY:



To: marmoute, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D7883: nodemap: keep track of the ondisk id of nodemap blocks

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
marmoute added a comment.
marmoute updated this revision to Diff 19895.


  rebase to latest default

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7883?vs=19836&id=19895

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7883/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7883

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -221,6 +221,11 @@
 
     contains up to 16 entry indexed from 0 to 15"""
 
+    def __init__(self):
+        super(Block, self).__init__()
+        # If this block exist on disk, here is its ID
+        self.ondisk_id = None
+
     def __iter__(self):
         return iter(self.get(i) for i in range(16))
 
@@ -323,8 +328,8 @@
     new_blocks = []
     for i in range(0, len(data), S_BLOCK.size):
         block = Block()
-        ondisk_id = len(block_map)
-        block_map[ondisk_id] = block
+        block.ondisk_id = len(block_map)
+        block_map[block.ondisk_id] = block
         block_data = data[i : i + S_BLOCK.size]
         values = S_BLOCK.unpack(block_data)
         new_blocks.append((block, values))



To: marmoute, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D7883: nodemap: keep track of the ondisk id of nodemap blocks

martinvonz (Martin von Zweigbergk)
In reply to this post by martinvonz (Martin von Zweigbergk)
Closed by commit rHGf0862ee1a31e: nodemap: keep track of the ondisk id of nodemap blocks (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7883?vs=19895&id=20116

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7883/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7883

AFFECTED FILES
  mercurial/revlogutils/nodemap.py

CHANGE DETAILS

diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py
+++ b/mercurial/revlogutils/nodemap.py
@@ -221,6 +221,11 @@
 
     contains up to 16 entry indexed from 0 to 15"""
 
+    def __init__(self):
+        super(Block, self).__init__()
+        # If this block exist on disk, here is its ID
+        self.ondisk_id = None
+
     def __iter__(self):
         return iter(self.get(i) for i in range(16))
 
@@ -323,8 +328,8 @@
     new_blocks = []
     for i in range(0, len(data), S_BLOCK.size):
         block = Block()
-        ondisk_id = len(block_map)
-        block_map[ondisk_id] = block
+        block.ondisk_id = len(block_map)
+        block_map[block.ondisk_id] = block
         block_data = data[i : i + S_BLOCK.size]
         values = S_BLOCK.unpack(block_data)
         new_blocks.append((block, values))



To: marmoute, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel