Show More
@@ -232,13 +232,13 b' class localrepository:' | |||
|
232 | 232 | return False |
|
233 | 233 | |
|
234 | 234 | def undo(self): |
|
235 | wlock = self.wlock() | |
|
235 | 236 | lock = self.lock() |
|
236 | 237 | if os.path.exists(self.join("undo")): |
|
237 | 238 | self.ui.status(_("rolling back last transaction\n")) |
|
238 | 239 | transaction.rollback(self.opener, self.join("undo")) |
|
239 | self.dirstate = None | |
|
240 | 240 | util.rename(self.join("undo.dirstate"), self.join("dirstate")) |
|
241 | self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root) | |
|
241 | self.dirstate.read() | |
|
242 | 242 | else: |
|
243 | 243 | self.ui.warn(_("no undo information available\n")) |
|
244 | 244 | |
@@ -251,6 +251,17 b' class localrepository:' | |||
|
251 | 251 | return lock.lock(self.join("lock"), wait) |
|
252 | 252 | raise inst |
|
253 | 253 | |
|
254 | def wlock(self, wait=1): | |
|
255 | try: | |
|
256 | wlock = lock.lock(self.join("wlock"), 0, self.dirstate.write) | |
|
257 | except lock.LockHeld, inst: | |
|
258 | if not wait: | |
|
259 | raise inst | |
|
260 | self.ui.warn(_("waiting for lock held by %s\n") % inst.args[0]) | |
|
261 | wlock = lock.lock(self.join("wlock"), wait, self.dirstate.write) | |
|
262 | self.dirstate.read() | |
|
263 | return wlock | |
|
264 | ||
|
254 | 265 | def rawcommit(self, files, text, user, date, p1=None, p2=None): |
|
255 | 266 | orig_parent = self.dirstate.parents()[0] or nullid |
|
256 | 267 | p1 = p1 or self.dirstate.parents()[0] or nullid |
@@ -267,6 +278,8 b' class localrepository:' | |||
|
267 | 278 | else: |
|
268 | 279 | update_dirstate = 0 |
|
269 | 280 | |
|
281 | wlock = self.wlock() | |
|
282 | lock = self.lock() | |
|
270 | 283 | tr = self.transaction() |
|
271 | 284 | mm = m1.copy() |
|
272 | 285 | mfm = mf1.copy() |
@@ -355,6 +368,7 b' class localrepository:' | |||
|
355 | 368 | if not self.hook("precommit"): |
|
356 | 369 | return None |
|
357 | 370 | |
|
371 | wlock = self.wlock() | |
|
358 | 372 | lock = self.lock() |
|
359 | 373 | tr = self.transaction() |
|
360 | 374 | |
@@ -526,6 +540,7 b' class localrepository:' | |||
|
526 | 540 | return (c, a, d, u) |
|
527 | 541 | |
|
528 | 542 | def add(self, list): |
|
543 | wlock = self.wlock() | |
|
529 | 544 | for f in list: |
|
530 | 545 | p = self.wjoin(f) |
|
531 | 546 | if not os.path.exists(p): |
@@ -538,6 +553,7 b' class localrepository:' | |||
|
538 | 553 | self.dirstate.update([f], "a") |
|
539 | 554 | |
|
540 | 555 | def forget(self, list): |
|
556 | wlock = self.wlock() | |
|
541 | 557 | for f in list: |
|
542 | 558 | if self.dirstate.state(f) not in 'ai': |
|
543 | 559 | self.ui.warn(_("%s not added!\n") % f) |
@@ -551,6 +567,7 b' class localrepository:' | |||
|
551 | 567 | util.unlink(self.wjoin(f)) |
|
552 | 568 | except OSError, inst: |
|
553 | 569 | if inst.errno != errno.ENOENT: raise |
|
570 | wlock = self.wlock() | |
|
554 | 571 | for f in list: |
|
555 | 572 | p = self.wjoin(f) |
|
556 | 573 | if os.path.exists(p): |
@@ -568,6 +585,7 b' class localrepository:' | |||
|
568 | 585 | mn = self.changelog.read(p)[0] |
|
569 | 586 | mf = self.manifest.readflags(mn) |
|
570 | 587 | m = self.manifest.read(mn) |
|
588 | wlock = self.wlock() | |
|
571 | 589 | for f in list: |
|
572 | 590 | if self.dirstate.state(f) not in "r": |
|
573 | 591 | self.ui.warn("%s not removed!\n" % f) |
@@ -584,6 +602,7 b' class localrepository:' | |||
|
584 | 602 | elif not os.path.isfile(p): |
|
585 | 603 | self.ui.warn(_("copy failed: %s is not a file\n") % dest) |
|
586 | 604 | else: |
|
605 | wlock = self.wlock() | |
|
587 | 606 | if self.dirstate.state(dest) == '?': |
|
588 | 607 | self.dirstate.update([dest], "a") |
|
589 | 608 | self.dirstate.copy(source, dest) |
@@ -1374,6 +1393,9 b' class localrepository:' | |||
|
1374 | 1393 | mw[f] = "" |
|
1375 | 1394 | mfw[f] = util.is_exec(self.wjoin(f), mfw.get(f, False)) |
|
1376 | 1395 | |
|
1396 | if moddirstate: | |
|
1397 | wlock = self.wlock() | |
|
1398 | ||
|
1377 | 1399 | for f in d: |
|
1378 | 1400 | if f in mw: del mw[f] |
|
1379 | 1401 |
General Comments 0
You need to be logged in to leave comments.
Login now