##// END OF EJS Templates
dirstate: filecacheify _branch...
Idan Kamara -
r16201:fb7c4c14 stable
parent child Browse files
Show More
@@ -14,6 +14,12 b' import cStringIO'
14 14
15 15 _format = ">cllll"
16 16 propertycache = util.propertycache
17 filecache = scmutil.filecache
18
19 class repocache(filecache):
20 """filecache for files in .hg/"""
21 def join(self, obj, fname):
22 return obj._opener.join(fname)
17 23
18 24 def _finddirs(path):
19 25 pos = path.rfind('/')
@@ -78,7 +84,7 b' class dirstate(object):'
78 84 f['.'] = '.' # prevents useless util.fspath() invocation
79 85 return f
80 86
81 @propertycache
87 @repocache('branch')
82 88 def _branch(self):
83 89 try:
84 90 return self._opener.read("branch").strip() or "default"
@@ -212,6 +212,13 b' def rollback(server):'
212 212 runcommand(server, ['rollback'])
213 213 runcommand(server, ['phase', '-r', '.'])
214 214
215 def branch(server):
216 readchannel(server)
217 runcommand(server, ['branch'])
218 os.system('hg branch foo')
219 runcommand(server, ['branch'])
220 os.system('hg branch default')
221
215 222 if __name__ == '__main__':
216 223 os.system('hg init')
217 224
@@ -232,3 +239,4 b" if __name__ == '__main__':"
232 239 check(tagscache)
233 240 check(setphase)
234 241 check(rollback)
242 check(branch)
@@ -145,3 +145,14 b' repository tip rolled back to revision 3'
145 145 working directory now based on revision 3
146 146 runcommand phase -r .
147 147 3: public
148
149 testing branch:
150
151 runcommand branch
152 default
153 marked working directory as branch foo
154 (branches are permanent and global, did you want a bookmark?)
155 runcommand branch
156 foo
157 marked working directory as branch default
158 (branches are permanent and global, did you want a bookmark?)
General Comments 0
You need to be logged in to leave comments. Login now