Show More
@@ -251,8 +251,8 b' def shrink(ui, repo, **opts):' | |||||
251 | if not opts.get('dry_run'): |
|
251 | if not opts.get('dry_run'): | |
252 | # racy, both files cannot be renamed atomically |
|
252 | # racy, both files cannot be renamed atomically | |
253 | # copy files |
|
253 | # copy files | |
254 |
util.os |
|
254 | util.oslink(indexfn, oldindexfn) | |
255 |
ignoremissing(util.os |
|
255 | ignoremissing(util.oslink)(datafn, olddatafn) | |
256 |
|
256 | |||
257 | # rename |
|
257 | # rename | |
258 | util.rename(tmpindexfn, indexfn) |
|
258 | util.rename(tmpindexfn, indexfn) |
@@ -132,7 +132,7 b' def do_relink(src, dst, files, ui):' | |||||
132 | bak = dst + '.bak' |
|
132 | bak = dst + '.bak' | |
133 | os.rename(dst, bak) |
|
133 | os.rename(dst, bak) | |
134 | try: |
|
134 | try: | |
135 |
util.os |
|
135 | util.oslink(src, dst) | |
136 | except OSError: |
|
136 | except OSError: | |
137 | os.rename(bak, dst) |
|
137 | os.rename(bak, dst) | |
138 | raise |
|
138 | raise |
@@ -12,7 +12,7 b' posixfile = open' | |||||
12 | nulldev = '/dev/null' |
|
12 | nulldev = '/dev/null' | |
13 | normpath = os.path.normpath |
|
13 | normpath = os.path.normpath | |
14 | samestat = os.path.samestat |
|
14 | samestat = os.path.samestat | |
15 |
os |
|
15 | oslink = os.link | |
16 | unlink = os.unlink |
|
16 | unlink = os.unlink | |
17 | rename = os.rename |
|
17 | rename = os.rename | |
18 | expandglobs = False |
|
18 | expandglobs = False |
@@ -435,7 +435,7 b' def copyfiles(src, dst, hardlink=None):' | |||||
435 | else: |
|
435 | else: | |
436 | if hardlink: |
|
436 | if hardlink: | |
437 | try: |
|
437 | try: | |
438 |
os |
|
438 | oslink(src, dst) | |
439 | except (IOError, OSError): |
|
439 | except (IOError, OSError): | |
440 | hardlink = False |
|
440 | hardlink = False | |
441 | shutil.copy(src, dst) |
|
441 | shutil.copy(src, dst) | |
@@ -624,7 +624,7 b' def checknlink(testfile):' | |||||
624 | fd = None |
|
624 | fd = None | |
625 | try: |
|
625 | try: | |
626 | try: |
|
626 | try: | |
627 |
os |
|
627 | oslink(f1, f2) | |
628 | except OSError: |
|
628 | except OSError: | |
629 | return False |
|
629 | return False | |
630 |
|
630 |
@@ -140,7 +140,7 b' def _getfileinfo(name):' | |||||
140 | finally: |
|
140 | finally: | |
141 | _kernel32.CloseHandle(fh) |
|
141 | _kernel32.CloseHandle(fh) | |
142 |
|
142 | |||
143 |
def os |
|
143 | def oslink(src, dst): | |
144 | try: |
|
144 | try: | |
145 | if not _kernel32.CreateHardLinkA(dst, src, None): |
|
145 | if not _kernel32.CreateHardLinkA(dst, src, None): | |
146 | _raiseoserror(src) |
|
146 | _raiseoserror(src) |
General Comments 0
You need to be logged in to leave comments.
Login now