equal
deleted
inserted
replaced
1074 |
1074 |
1075 if backup: |
1075 if backup: |
1076 absf = repo.wjoin(f) |
1076 absf = repo.wjoin(f) |
1077 orig = scmutil.origpath(ui, repo, absf) |
1077 orig = scmutil.origpath(ui, repo, absf) |
1078 try: |
1078 try: |
1079 # TODO Mercurial has always aborted if an untracked |
|
1080 # directory is replaced by a tracked file, or generally |
|
1081 # with file/directory merges. This needs to be sorted out. |
|
1082 if repo.wvfs.isfileorlink(f): |
1079 if repo.wvfs.isfileorlink(f): |
1083 util.rename(absf, orig) |
1080 util.rename(absf, orig) |
1084 except OSError as e: |
1081 except OSError as e: |
1085 if e.errno != errno.ENOENT: |
1082 if e.errno != errno.ENOENT: |
1086 raise |
1083 raise |
1087 |
1084 |
|
1085 if repo.wvfs.isdir(f): |
|
1086 repo.wvfs.removedirs(f) |
1088 wwrite(f, fctx(f).data(), flags, backgroundclose=True) |
1087 wwrite(f, fctx(f).data(), flags, backgroundclose=True) |
1089 if i == 100: |
1088 if i == 100: |
1090 yield i, f |
1089 yield i, f |
1091 i = 0 |
1090 i = 0 |
1092 i += 1 |
1091 i += 1 |