2010-06-10

Recursively Change All Files Mode

When people copy a hg repository from Windows to linux, he may meet a annoying problem: All the files have x mode linux. You can check this by
>hg st
all the files are modified
>hg diff
no context difference.

A simple solution is to recursively remove the x mode of all files by
>find . -type f | xargs chmod a-x

In mercurial, you can use 'hg revert ${changed-file}' to restore the mode of file, but you need to make it sure that except of mode, the file is nothing changed.

No comments:

Post a Comment