equal
deleted
inserted
replaced
932 pre = b"%s~%s" % (os.path.basename(fullbase), prefix) |
932 pre = b"%s~%s" % (os.path.basename(fullbase), prefix) |
933 if tmproot: |
933 if tmproot: |
934 name = os.path.join(tmproot, pre) |
934 name = os.path.join(tmproot, pre) |
935 if ext: |
935 if ext: |
936 name += ext |
936 name += ext |
937 f = open(name, r"wb") |
937 f = open(name, "wb") |
938 else: |
938 else: |
939 fd, name = pycompat.mkstemp(prefix=pre + b'.', suffix=ext) |
939 fd, name = pycompat.mkstemp(prefix=pre + b'.', suffix=ext) |
940 f = os.fdopen(fd, r"wb") |
940 f = os.fdopen(fd, "wb") |
941 return f, name |
941 return f, name |
942 |
942 |
943 def tempfromcontext(prefix, ctx): |
943 def tempfromcontext(prefix, ctx): |
944 f, name = maketempfrompath(prefix, ctx.path()) |
944 f, name = maketempfrompath(prefix, ctx.path()) |
945 data = repo.wwritedata(ctx.path(), ctx.data()) |
945 data = repo.wwritedata(ctx.path(), ctx.data()) |