##// END OF EJS Templates
journal: execute setup procedures for already instantiated dirstate...
FUJIWARA Katsunori -
r33383:774beab9 default
parent child Browse files
Show More
@@ -70,18 +70,28 b' def reposetup(ui, repo):'
70 70 if repo.local():
71 71 repo.journal = journalstorage(repo)
72 72
73 dirstate, cached = localrepo.isfilecached(repo, 'dirstate')
74 if cached:
75 # already instantiated dirstate isn't yet marked as
76 # "journal"-ing, even though repo.dirstate() was already
77 # wrapped by own wrapdirstate()
78 _setupdirstate(repo, dirstate)
79
73 80 def runcommand(orig, lui, repo, cmd, fullargs, *args):
74 81 """Track the command line options for recording in the journal"""
75 82 journalstorage.recordcommand(*fullargs)
76 83 return orig(lui, repo, cmd, fullargs, *args)
77 84
85 def _setupdirstate(repo, dirstate):
86 dirstate.journalstorage = repo.journal
87 dirstate.addparentchangecallback('journal', recorddirstateparents)
88
78 89 # hooks to record dirstate changes
79 90 def wrapdirstate(orig, repo):
80 91 """Make journal storage available to the dirstate object"""
81 92 dirstate = orig(repo)
82 93 if util.safehasattr(repo, 'journal'):
83 dirstate.journalstorage = repo.journal
84 dirstate.addparentchangecallback('journal', recorddirstateparents)
94 _setupdirstate(repo, dirstate)
85 95 return dirstate
86 96
87 97 def recorddirstateparents(dirstate, old, new):
General Comments 0
You need to be logged in to leave comments. Login now