Show More
@@ -38,9 +38,12 b' def _decdirs(dirs, path):' | |||
|
38 | 38 | class dirstate(object): |
|
39 | 39 | |
|
40 | 40 | def __init__(self, opener, ui, root): |
|
41 |
'''Create a new dirstate object. |
|
|
42 | that can be used to open the dirstate file; root is the root of the | |
|
43 | directory tracked by the dirstate.''' | |
|
41 | '''Create a new dirstate object. | |
|
42 | ||
|
43 | opener is an open()-like callable that can be used to open the | |
|
44 | dirstate file; root is the root of the directory tracked by | |
|
45 | the dirstate. | |
|
46 | ''' | |
|
44 | 47 | self._opener = opener |
|
45 | 48 | self._root = root |
|
46 | 49 | self._rootdir = os.path.join(root, '') |
@@ -175,6 +178,7 b' class dirstate(object):' | |||
|
175 | 178 | |
|
176 | 179 | def __getitem__(self, key): |
|
177 | 180 | '''Return the current state of key (a filename) in the dirstate. |
|
181 | ||
|
178 | 182 | States are: |
|
179 | 183 | n normal |
|
180 | 184 | m needs merging |
@@ -227,8 +231,7 b' class dirstate(object):' | |||
|
227 | 231 | self._dirty = False |
|
228 | 232 | |
|
229 | 233 | def copy(self, source, dest): |
|
230 | """Mark dest as a copy of source. Unmark dest if source is None. | |
|
231 | """ | |
|
234 | """Mark dest as a copy of source. Unmark dest if source is None.""" | |
|
232 | 235 | if source == dest: |
|
233 | 236 | return |
|
234 | 237 | self._dirty = True |
@@ -266,7 +269,7 b' class dirstate(object):' | |||
|
266 | 269 | _incdirs(self._dirs, f) |
|
267 | 270 | |
|
268 | 271 | def normal(self, f): |
|
269 |
' |
|
|
272 | '''Mark a file normal and clean.''' | |
|
270 | 273 | self._dirty = True |
|
271 | 274 | self._addpath(f) |
|
272 | 275 | s = os.lstat(self._join(f)) |
@@ -275,7 +278,7 b' class dirstate(object):' | |||
|
275 | 278 | del self._copymap[f] |
|
276 | 279 | |
|
277 | 280 | def normallookup(self, f): |
|
278 |
' |
|
|
281 | '''Mark a file normal, but possibly dirty.''' | |
|
279 | 282 | if self._pl[1] != nullid and f in self._map: |
|
280 | 283 | # if there is a merge going on and the file was either |
|
281 | 284 | # in state 'm' or dirty before being removed, restore that state. |
@@ -298,7 +301,7 b' class dirstate(object):' | |||
|
298 | 301 | del self._copymap[f] |
|
299 | 302 | |
|
300 | 303 | def normaldirty(self, f): |
|
301 |
' |
|
|
304 | '''Mark a file normal, but dirty.''' | |
|
302 | 305 | self._dirty = True |
|
303 | 306 | self._addpath(f) |
|
304 | 307 | self._map[f] = ('n', 0, -2, -1) |
@@ -306,7 +309,7 b' class dirstate(object):' | |||
|
306 | 309 | del self._copymap[f] |
|
307 | 310 | |
|
308 | 311 | def add(self, f): |
|
309 |
' |
|
|
312 | '''Mark a file added.''' | |
|
310 | 313 | self._dirty = True |
|
311 | 314 | self._addpath(f, True) |
|
312 | 315 | self._map[f] = ('a', 0, -1, -1) |
@@ -314,7 +317,7 b' class dirstate(object):' | |||
|
314 | 317 | del self._copymap[f] |
|
315 | 318 | |
|
316 | 319 | def remove(self, f): |
|
317 |
' |
|
|
320 | '''Mark a file removed.''' | |
|
318 | 321 | self._dirty = True |
|
319 | 322 | self._droppath(f) |
|
320 | 323 | size = 0 |
@@ -329,7 +332,7 b' class dirstate(object):' | |||
|
329 | 332 | del self._copymap[f] |
|
330 | 333 | |
|
331 | 334 | def merge(self, f): |
|
332 |
' |
|
|
335 | '''Mark a file merged.''' | |
|
333 | 336 | self._dirty = True |
|
334 | 337 | s = os.lstat(self._join(f)) |
|
335 | 338 | self._addpath(f) |
@@ -338,7 +341,7 b' class dirstate(object):' | |||
|
338 | 341 | del self._copymap[f] |
|
339 | 342 | |
|
340 | 343 | def forget(self, f): |
|
341 |
' |
|
|
344 | '''Forget a file.''' | |
|
342 | 345 | self._dirty = True |
|
343 | 346 | try: |
|
344 | 347 | self._droppath(f) |
General Comments 0
You need to be logged in to leave comments.
Login now