mercurial/localrepo.py
changeset 50070 c8f32aa80dca
parent 50069 81870c92c293
child 50071 d91fc026071c
equal deleted inserted replaced
50069:81870c92c293 50070:c8f32aa80dca
     8 
     8 
     9 
     9 
    10 import functools
    10 import functools
    11 import os
    11 import os
    12 import random
    12 import random
       
    13 import re
    13 import sys
    14 import sys
    14 import time
    15 import time
    15 import weakref
    16 import weakref
    16 
    17 
    17 from concurrent import futures
    18 from concurrent import futures
    98 
    99 
    99 release = lockmod.release
   100 release = lockmod.release
   100 urlerr = util.urlerr
   101 urlerr = util.urlerr
   101 urlreq = util.urlreq
   102 urlreq = util.urlreq
   102 
   103 
       
   104 RE_SKIP_DIRSTATE_ROLLBACK = re.compile(b"^(dirstate|narrowspec.dirstate).*")
       
   105 
   103 # set of (path, vfs-location) tuples. vfs-location is:
   106 # set of (path, vfs-location) tuples. vfs-location is:
   104 # - 'plain for vfs relative paths
   107 # - 'plain for vfs relative paths
   105 # - '' for svfs relative paths
   108 # - '' for svfs relative paths
   106 _cachedfiles = set()
   109 _cachedfiles = set()
   107 
   110 
  2746         if dryrun:
  2749         if dryrun:
  2747             return 0
  2750             return 0
  2748 
  2751 
  2749         self.destroying()
  2752         self.destroying()
  2750         vfsmap = {b'plain': self.vfs, b'': self.svfs}
  2753         vfsmap = {b'plain': self.vfs, b'': self.svfs}
       
  2754         skip_journal_pattern = None
       
  2755         if not parentgone:
       
  2756             skip_journal_pattern = RE_SKIP_DIRSTATE_ROLLBACK
  2751         transaction.rollback(
  2757         transaction.rollback(
  2752             self.svfs, vfsmap, b'undo', ui.warn, checkambigfiles=_cachedfiles
  2758             self.svfs,
       
  2759             vfsmap,
       
  2760             b'undo',
       
  2761             ui.warn,
       
  2762             checkambigfiles=_cachedfiles,
       
  2763             skip_journal_pattern=skip_journal_pattern,
  2753         )
  2764         )
  2754         bookmarksvfs = bookmarks.bookmarksvfs(self)
  2765         bookmarksvfs = bookmarks.bookmarksvfs(self)
  2755         if bookmarksvfs.exists(b'undo.bookmarks'):
  2766         if bookmarksvfs.exists(b'undo.bookmarks'):
  2756             bookmarksvfs.rename(
  2767             bookmarksvfs.rename(
  2757                 b'undo.bookmarks', b'bookmarks', checkambig=True
  2768                 b'undo.bookmarks', b'bookmarks', checkambig=True