hgext/largefiles/reposetup.py
changeset 18148 bf6252d12c34
parent 18145 93206823bd61
child 18149 2dcc3653b361
equal deleted inserted replaced
18147:79f2493198e1 18148:bf6252d12c34
   155                             newfiles.extend((f, sf))
   155                             newfiles.extend((f, sf))
   156                         else:
   156                         else:
   157                             newfiles.append(f)
   157                             newfiles.append(f)
   158                     return newfiles
   158                     return newfiles
   159 
   159 
   160                 # Create a function that we can use to override what is
       
   161                 # normally the ignore matcher.  We've already checked
       
   162                 # for ignored files on the first dirstate walk, and
       
   163                 # unnecessarily re-checking here causes a huge performance
       
   164                 # hit because lfdirstate only knows about largefiles
       
   165                 def _ignoreoverride(self):
       
   166                     return False
       
   167 
       
   168                 m = copy.copy(match)
   160                 m = copy.copy(match)
   169                 m._files = tostandins(m._files)
   161                 m._files = tostandins(m._files)
   170 
   162 
   171                 result = super(lfilesrepo, self).status(node1, node2, m,
   163                 result = super(lfilesrepo, self).status(node1, node2, m,
   172                     ignored, clean, unknown, listsubrepos)
   164                     ignored, clean, unknown, listsubrepos)
   173                 if working:
   165                 if working:
   174                     try:
   166                     try:
   175                         # Any non-largefiles that were explicitly listed must be
       
   176                         # taken out or lfdirstate.status will report an error.
       
   177                         # The status of these files was already computed using
       
   178                         # super's status.
       
   179                         # Override lfdirstate's ignore matcher to not do
       
   180                         # anything
       
   181                         origignore = lfdirstate._ignore
       
   182                         lfdirstate._ignore = _ignoreoverride
       
   183 
   167 
   184                         def sfindirstate(f):
   168                         def sfindirstate(f):
   185                             sf = lfutil.standin(f)
   169                             sf = lfutil.standin(f)
   186                             dirstate = self.dirstate
   170                             dirstate = self.dirstate
   187                             return sf in dirstate or sf in dirstate.dirs()
   171                             return sf in dirstate or sf in dirstate.dirs()
   218                                     else:
   202                                     else:
   219                                         clean.append(lfile)
   203                                         clean.append(lfile)
   220                                 else:
   204                                 else:
   221                                     added.append(lfile)
   205                                     added.append(lfile)
   222                     finally:
   206                     finally:
   223                         # Replace the original ignore function
   207                         pass
   224                         lfdirstate._ignore = origignore
       
   225 
   208 
   226                     # Standins no longer found in lfdirstate has been removed
   209                     # Standins no longer found in lfdirstate has been removed
   227                     for standin in ctx1.manifest():
   210                     for standin in ctx1.manifest():
   228                         if not lfutil.isstandin(standin):
   211                         if not lfutil.isstandin(standin):
   229                             continue
   212                             continue