##// 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 if repo.local():
70 if repo.local():
71 repo.journal = journalstorage(repo)
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 def runcommand(orig, lui, repo, cmd, fullargs, *args):
80 def runcommand(orig, lui, repo, cmd, fullargs, *args):
74 """Track the command line options for recording in the journal"""
81 """Track the command line options for recording in the journal"""
75 journalstorage.recordcommand(*fullargs)
82 journalstorage.recordcommand(*fullargs)
76 return orig(lui, repo, cmd, fullargs, *args)
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 # hooks to record dirstate changes
89 # hooks to record dirstate changes
79 def wrapdirstate(orig, repo):
90 def wrapdirstate(orig, repo):
80 """Make journal storage available to the dirstate object"""
91 """Make journal storage available to the dirstate object"""
81 dirstate = orig(repo)
92 dirstate = orig(repo)
82 if util.safehasattr(repo, 'journal'):
93 if util.safehasattr(repo, 'journal'):
83 dirstate.journalstorage = repo.journal
94 _setupdirstate(repo, dirstate)
84 dirstate.addparentchangecallback('journal', recorddirstateparents)
85 return dirstate
95 return dirstate
86
96
87 def recorddirstateparents(dirstate, old, new):
97 def recorddirstateparents(dirstate, old, new):
General Comments 0
You need to be logged in to leave comments. Login now