diff hgext/largefiles/lfutil.py @ 47593:f927ad5a4e2c

dirstate: add a `set_tracked` method for "hg add"-like usage This is a step further toward clarifying the semantic of various dirstate call. Having a dedicated function comes with a couple of benefits: 1) we can move duplicated logic about how to handle the previous state within the dirstate. Since we are sure this is always called in the same situation, we can implement that logic once in the dirstate. 2) having a dedicated method for this case unlock also having a dedicated method for the other case and recording more information at that time. All this leading having more code within the dirstate and higher level API that are less error prone. Differential Revision: https://phab.mercurial-scm.org/D11013
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Jul 2021 03:03:34 +0200
parents fa18a3bc40e8
children cce51119bfe6
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Sat Jul 10 23:31:51 2021 +0200
+++ b/hgext/largefiles/lfutil.py	Thu Jul 08 03:03:34 2021 +0200
@@ -162,6 +162,9 @@
     def __getitem__(self, key):
         return super(largefilesdirstate, self).__getitem__(unixpath(key))
 
+    def set_tracked(self, f):
+        return super(largefilesdirstate, self).set_tracked(unixpath(f))
+
     def normal(self, f):
         return super(largefilesdirstate, self).normal(unixpath(f))