Show More
@@ -47,6 +47,7 b' class localrepository(repo.repository):' | |||
|
47 | 47 | self.origroot = path |
|
48 | 48 | self.ui = ui.ui(parentui=parentui) |
|
49 | 49 | self.opener = util.opener(self.path) |
|
50 | self.sopener = util.opener(self.path) | |
|
50 | 51 | self.wopener = util.opener(self.root) |
|
51 | 52 | |
|
52 | 53 | try: |
@@ -66,8 +67,8 b' class localrepository(repo.repository):' | |||
|
66 | 67 | flags = revlog.REVLOG_DEFAULT_FLAGS |
|
67 | 68 | |
|
68 | 69 | v = self.revlogversion | flags |
|
69 | self.manifest = manifest.manifest(self.opener, v) | |
|
70 | self.changelog = changelog.changelog(self.opener, v) | |
|
70 | self.manifest = manifest.manifest(self.sopener, v) | |
|
71 | self.changelog = changelog.changelog(self.sopener, v) | |
|
71 | 72 | |
|
72 | 73 | # the changelog might not have the inline index flag |
|
73 | 74 | # on. If the format of the changelog is the same as found in |
@@ -356,13 +357,16 b' class localrepository(repo.repository):' | |||
|
356 | 357 | def join(self, f): |
|
357 | 358 | return os.path.join(self.path, f) |
|
358 | 359 | |
|
360 | def sjoin(self, f): | |
|
361 | return os.path.join(self.path, f) | |
|
362 | ||
|
359 | 363 | def wjoin(self, f): |
|
360 | 364 | return os.path.join(self.root, f) |
|
361 | 365 | |
|
362 | 366 | def file(self, f): |
|
363 | 367 | if f[0] == '/': |
|
364 | 368 | f = f[1:] |
|
365 | return filelog.filelog(self.opener, f, self.revlogversion) | |
|
369 | return filelog.filelog(self.sopener, f, self.revlogversion) | |
|
366 | 370 | |
|
367 | 371 | def changectx(self, changeid=None): |
|
368 | 372 | return context.changectx(self, changeid) |
@@ -442,17 +446,17 b' class localrepository(repo.repository):' | |||
|
442 | 446 | ds = "" |
|
443 | 447 | self.opener("journal.dirstate", "w").write(ds) |
|
444 | 448 | |
|
445 | tr = transaction.transaction(self.ui.warn, self.opener, | |
|
446 | self.join("journal"), | |
|
449 | tr = transaction.transaction(self.ui.warn, self.sopener, | |
|
450 | self.sjoin("journal"), | |
|
447 | 451 | aftertrans(self.path)) |
|
448 | 452 | self.transhandle = tr |
|
449 | 453 | return tr |
|
450 | 454 | |
|
451 | 455 | def recover(self): |
|
452 | 456 | l = self.lock() |
|
453 | if os.path.exists(self.join("journal")): | |
|
457 | if os.path.exists(self.sjoin("journal")): | |
|
454 | 458 | self.ui.status(_("rolling back interrupted transaction\n")) |
|
455 | transaction.rollback(self.opener, self.join("journal")) | |
|
459 | transaction.rollback(self.sopener, self.sjoin("journal")) | |
|
456 | 460 | self.reload() |
|
457 | 461 | return True |
|
458 | 462 | else: |
@@ -463,9 +467,9 b' class localrepository(repo.repository):' | |||
|
463 | 467 | if not wlock: |
|
464 | 468 | wlock = self.wlock() |
|
465 | 469 | l = self.lock() |
|
466 | if os.path.exists(self.join("undo")): | |
|
470 | if os.path.exists(self.sjoin("undo")): | |
|
467 | 471 | self.ui.status(_("rolling back last transaction\n")) |
|
468 | transaction.rollback(self.opener, self.join("undo")) | |
|
472 | transaction.rollback(self.sopener, self.sjoin("undo")) | |
|
469 | 473 | util.rename(self.join("undo.dirstate"), self.join("dirstate")) |
|
470 | 474 | self.reload() |
|
471 | 475 | self.wreload() |
@@ -484,26 +488,25 b' class localrepository(repo.repository):' | |||
|
484 | 488 | def do_lock(self, lockname, wait, releasefn=None, acquirefn=None, |
|
485 | 489 | desc=None): |
|
486 | 490 | try: |
|
487 |
l = lock.lock( |
|
|
491 | l = lock.lock(lockname, 0, releasefn, desc=desc) | |
|
488 | 492 | except lock.LockHeld, inst: |
|
489 | 493 | if not wait: |
|
490 | 494 | raise |
|
491 | 495 | self.ui.warn(_("waiting for lock on %s held by %s\n") % |
|
492 | 496 | (desc, inst.args[0])) |
|
493 | 497 | # default to 600 seconds timeout |
|
494 | l = lock.lock(self.join(lockname), | |
|
495 | int(self.ui.config("ui", "timeout") or 600), | |
|
498 | l = lock.lock(lockname, int(self.ui.config("ui", "timeout", "600")), | |
|
496 | 499 | releasefn, desc=desc) |
|
497 | 500 | if acquirefn: |
|
498 | 501 | acquirefn() |
|
499 | 502 | return l |
|
500 | 503 | |
|
501 | 504 | def lock(self, wait=1): |
|
502 | return self.do_lock("lock", wait, acquirefn=self.reload, | |
|
505 | return self.do_lock(self.sjoin("lock"), wait, acquirefn=self.reload, | |
|
503 | 506 | desc=_('repository %s') % self.origroot) |
|
504 | 507 | |
|
505 | 508 | def wlock(self, wait=1): |
|
506 | return self.do_lock("wlock", wait, self.dirstate.write, | |
|
509 | return self.do_lock(self.join("wlock"), wait, self.dirstate.write, | |
|
507 | 510 | self.wreload, |
|
508 | 511 | desc=_('working directory of %s') % self.origroot) |
|
509 | 512 | |
@@ -1686,7 +1689,8 b' class localrepository(repo.repository):' | |||
|
1686 | 1689 | # inconsistent view |
|
1687 | 1690 | cl = None |
|
1688 | 1691 | try: |
|
1689 |
cl = appendfile.appendchangelog(self.opener, |
|
|
1692 | cl = appendfile.appendchangelog(self.sopener, | |
|
1693 | self.changelog.version) | |
|
1690 | 1694 | |
|
1691 | 1695 | oldheads = len(cl.heads()) |
|
1692 | 1696 | |
@@ -1729,7 +1733,8 b' class localrepository(repo.repository):' | |||
|
1729 | 1733 | cl.cleanup() |
|
1730 | 1734 | |
|
1731 | 1735 | # make changelog see real files again |
|
1732 |
self.changelog = changelog.changelog(self.opener, |
|
|
1736 | self.changelog = changelog.changelog(self.sopener, | |
|
1737 | self.changelog.version) | |
|
1733 | 1738 | self.changelog.checkinlinesize(tr) |
|
1734 | 1739 | |
|
1735 | 1740 | newheads = len(self.changelog.heads()) |
@@ -1773,7 +1778,7 b' class localrepository(repo.repository):' | |||
|
1773 | 1778 | name, size = fp.readline().split('\0', 1) |
|
1774 | 1779 | size = int(size) |
|
1775 | 1780 | self.ui.debug('adding %s (%s)\n' % (name, util.bytecount(size))) |
|
1776 | ofp = self.opener(name, 'w') | |
|
1781 | ofp = self.sopener(name, 'w') | |
|
1777 | 1782 | for chunk in util.filechunkiter(fp, limit=size): |
|
1778 | 1783 | ofp.write(chunk) |
|
1779 | 1784 | ofp.close() |
@@ -36,6 +36,7 b' class statichttprepository(localrepo.loc' | |||
|
36 | 36 | self.ui = ui |
|
37 | 37 | self.revlogversion = 0 |
|
38 | 38 | self.opener = opener(self.path) |
|
39 | self.sopener = opener(self.path) | |
|
39 | 40 | self.manifest = manifest.manifest(self.opener) |
|
40 | 41 | self.changelog = changelog.changelog(self.opener) |
|
41 | 42 | self.tagscache = None |
General Comments 0
You need to be logged in to leave comments.
Login now