• Matt Harbison's avatar
    visdiff: preserve the executable bit after editing a file · fbc4c289547c
    Matt Harbison authored
    I noticed on OS X that editing an executable shell script in visual diff would
    reset the file to 644 after saving.  The problem only occurred if a snapshot was
    required, e.g. if there was more than one file in the diff.  It looks like
    util.copyfile() preserves the mode when copying from $tmp back to wdir(), so it
    was just a matter of copying the mode when first creating the temp file.
    This code was ripped off from the extdiff extension prior to it switching to
    using archive, but I left out the symlink case since this code isn't using
    wopener.  Perhaps this should be switched to use archive as well, which would
    allow subrepo support.
    branch : stable