12 import lock, transaction, store, encoding |
12 import lock, transaction, store, encoding |
13 import scmutil, util, extensions, hook, error |
13 import scmutil, util, extensions, hook, error |
14 import match as matchmod |
14 import match as matchmod |
15 import merge as mergemod |
15 import merge as mergemod |
16 import tags as tagsmod |
16 import tags as tagsmod |
17 import url as urlmod |
|
18 from lock import release |
17 from lock import release |
19 import weakref, errno, os, time, inspect |
18 import weakref, errno, os, time, inspect |
20 propertycache = util.propertycache |
19 propertycache = util.propertycache |
21 |
20 |
22 class localrepository(repo.repository): |
21 class localrepository(repo.repository): |
1693 # inconsistent view |
1692 # inconsistent view |
1694 cl = self.changelog |
1693 cl = self.changelog |
1695 cl.delayupdate() |
1694 cl.delayupdate() |
1696 oldheads = cl.heads() |
1695 oldheads = cl.heads() |
1697 |
1696 |
1698 tr = self.transaction("\n".join([srctype, urlmod.hidepassword(url)])) |
1697 tr = self.transaction("\n".join([srctype, util.hidepassword(url)])) |
1699 try: |
1698 try: |
1700 trp = weakref.proxy(tr) |
1699 trp = weakref.proxy(tr) |
1701 # pull off the changeset group |
1700 # pull off the changeset group |
1702 self.ui.status(_("adding changesets\n")) |
1701 self.ui.status(_("adding changesets\n")) |
1703 clstart = len(cl) |
1702 clstart = len(cl) |
1935 for src, dest in renamefiles: |
1934 for src, dest in renamefiles: |
1936 util.rename(src, dest) |
1935 util.rename(src, dest) |
1937 return a |
1936 return a |
1938 |
1937 |
1939 def instance(ui, path, create): |
1938 def instance(ui, path, create): |
1940 return localrepository(ui, urlmod.localpath(path), create) |
1939 return localrepository(ui, util.localpath(path), create) |
1941 |
1940 |
1942 def islocal(path): |
1941 def islocal(path): |
1943 return True |
1942 return True |