mercurial/patch.py
changeset 16834 cafd8a8fb713
parent 16828 8abee656e14c
child 17299 e51d4aedace9
equal deleted inserted replaced
16833:7b460b49bf7b 16834:cafd8a8fb713
    10 import tempfile, zlib, shutil
    10 import tempfile, zlib, shutil
    11 
    11 
    12 from i18n import _
    12 from i18n import _
    13 from node import hex, nullid, short
    13 from node import hex, nullid, short
    14 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error
    14 import base85, mdiff, scmutil, util, diffhelpers, copies, encoding, error
    15 import collections, context
    15 import context
    16 
    16 
    17 gitre = re.compile('diff --git a/(.*) b/(.*)')
    17 gitre = re.compile('diff --git a/(.*) b/(.*)')
    18 
    18 
    19 class PatchError(Exception):
    19 class PatchError(Exception):
    20     pass
    20     pass
  1595     if not node1 and not node2:
  1595     if not node1 and not node2:
  1596         node1 = repo.dirstate.p1()
  1596         node1 = repo.dirstate.p1()
  1597 
  1597 
  1598     def lrugetfilectx():
  1598     def lrugetfilectx():
  1599         cache = {}
  1599         cache = {}
  1600         order = collections.deque()
  1600         order = util.deque()
  1601         def getfilectx(f, ctx):
  1601         def getfilectx(f, ctx):
  1602             fctx = ctx.filectx(f, filelog=cache.get(f))
  1602             fctx = ctx.filectx(f, filelog=cache.get(f))
  1603             if f not in cache:
  1603             if f not in cache:
  1604                 if len(cache) > 20:
  1604                 if len(cache) > 20:
  1605                     del cache[order.popleft()]
  1605                     del cache[order.popleft()]