equal
deleted
inserted
replaced
583 def temp(prefix, ctx): |
583 def temp(prefix, ctx): |
584 fullbase, ext = os.path.splitext(ctx.path()) |
584 fullbase, ext = os.path.splitext(ctx.path()) |
585 pre = "%s~%s." % (os.path.basename(fullbase), prefix) |
585 pre = "%s~%s." % (os.path.basename(fullbase), prefix) |
586 (fd, name) = tempfile.mkstemp(prefix=pre, suffix=ext) |
586 (fd, name) = tempfile.mkstemp(prefix=pre, suffix=ext) |
587 data = repo.wwritedata(ctx.path(), ctx.data()) |
587 data = repo.wwritedata(ctx.path(), ctx.data()) |
588 f = os.fdopen(fd, "wb") |
588 f = os.fdopen(fd, pycompat.sysstr("wb")) |
589 f.write(data) |
589 f.write(data) |
590 f.close() |
590 f.close() |
591 return name |
591 return name |
592 |
592 |
593 if not fco.cmp(fcd): # files identical? |
593 if not fco.cmp(fcd): # files identical? |