[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Issue 99 - mtn:execute attr sometimes initialized wrong
From: |
code |
Subject: |
[Monotone-devel] Issue 99 - mtn:execute attr sometimes initialized wrong on Cygwin and MinGW (monotone) |
Date: |
Thu, 28 Oct 2010 01:28:15 GMT |
Hello,
A new issue has been created and assigned
to you:
99 - mtn:execute attr sometimes initialized wrong on Cygwin and MinGW
Project: monotone
Status: New
Reported by: Stephen Leake
Labels:
Type:Defect
Priority:Medium
Description:
For example, see the diff_on_missing_trailing_newline_at_end_of_file test;
file1 and file2 both have the mtn:execute attr set when using the
attr_init_function in std_hooks.lua
mtn version 0.47 and after
There are conflicting requirements for attr_init_functions["mtn:execute"]. On
one hand, if a project is multi-platform, it must produce the same answer for
the same file on all platforms, so revids are invariant across platforms.
On the other hand, if a project is single platform, it would be reasonable to
have use the same algorithm as the platform to mark executable files.
Since single platform projects are more common, it makes sense for the mtn
default to be appropriate for the current platform; projects with other needs
must override the hook.
This was discussed in issue 97. Adapting what Richard wrote:
Looking at the source, I'd say that the problem lies in the lua routine called
is_executable(), in unix/process.cc and win32/process.cc. win32/process.cc
does nothing (it just returns false), while unix/process.cc does what's
sensible for Unix.
Further analysis shows that (since mtn 0.47), Cygwin is regarded as unix by
configure.ac. This is probably normally a good thing, since it tries to
emulate unix... but when it comes to is_executable, maybe
that's not the best idea.
So we have a choice. Either add *-pc-cygwin in the case that catches Win32
platforms in configure.ac, or make is_executable in unix/process.cc a special
case for Cygwin.
(end adapt Richard)
Note that the default value for Win32 is also wrong; it should compare the file
extension to the PATHEXT environment variable, as the DOS shell does.
The problem on Cygwin is compounded by the fact that 'mtn checkout' marks some
files as executable even when they do not have the mtn:execute attr; for
example, file1 in diff_on_missing_trailing_newline_at_end_of_file.
--
Issue: http://code.monotone.ca/p/monotone/issues/99/
- [Monotone-devel] Issue 99 - mtn:execute attr sometimes initialized wrong on Cygwin and MinGW (monotone),
code <=