[issue2977] Mode changes not recognized on Windows

Jason R. Coombs bugs at mercurial.selenic.com
Mon Aug 29 17:26:25 CDT 2011


New submission from Jason R. Coombs <jaraco at jaraco.com>:

It appears that Mercurial doesn't honor file modes when used on Windows. I
first noticed this when attempting to set an executable bit using hg import
and this technique:
http://stackoverflow.com/questions/2702825/setting-mercurials-execute-bit-on-windows/2704912#2704912
(which did not work for me).

I additionally found that 'hg transplant' will fail on Windows with a
traceback if a revision being transplanted has only changes to the mode.

Consider this repo, attached. It has three revisions created thus:

# on a Unix machine
hg init foo
cd foo
echo foo > foo.sh
hg add foo.sh
hg ci -m "Adding foo"
chmod u+x foo.sh
hg ci -m "Making foo executable"
hg update null
# we have to create a bar branch with a revision in which to transplant 0 and 1
hg branch bar
echo bar > bar.txt
hg add bar.txt
hg ci -m "Adding bar"


Then, if you clone this repo (or copy it) to a Windows machine, and attempt
to transplant some revisions to bar, you get this:

PS C:\foo> hg transplant 0
applying 2bab1051568d
2bab1051568d transplanted to 959848bf0fc2
PS C:\foo> hg transplant 1
applying 33254b951253
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 1.9.1)
** Extensions loaded: graphlog, convert, rebase, mercurial_keyring, mq,
transplant, hggit, histedit, hgsubversion, onsub, collapse
Traceback (most recent call last):
  File "hg", line 42, in <module>
  File "mercurial\dispatch.pyo", line 27, in run
  File "mercurial\dispatch.pyo", line 64, in dispatch
  File "mercurial\dispatch.pyo", line 87, in _runcatch
  File "mercurial\dispatch.pyo", line 679, in _dispatch
  File "mercurial\dispatch.pyo", line 454, in runcommand
  File "mercurial\dispatch.pyo", line 733, in _runcommand
  File "mercurial\dispatch.pyo", line 687, in checkargs
  File "mercurial\dispatch.pyo", line 676, in <lambda>
  File "mercurial\util.pyo", line 385, in check
  File "mercurial\extensions.pyo", line 137, in wrap
  File "mercurial\util.pyo", line 385, in check
  File "hgext\mq.pyo", line 3218, in mqcommand
  File "mercurial\util.pyo", line 385, in check
  File "hgext\transplant.pyo", line 607, in transplant
  File "hgext\transplant.pyo", line 164, in apply
  File "hgext\transplant.pyo", line 265, in applyone
RuntimeError: nothing committed after transplant

It seems it's not possible to transplant that revision to the bar branch on
Windows. If one attempts it on Unix, it works fine.

It would be nice if mercurial honored the mode changes and could include
them, especially when the mode changes are explicitly available, such as in
the transplant or when importing a patch.

I acknowledge this might be a tricky problem since the file system may not
reflect the mode bits while on a Windows file system.

----------
files: foo.zip
messages: 17281
nosy: jaraco
priority: bug
status: unread
title: Mode changes not recognized on Windows

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2977>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.zip
Type: application/x-zip-compressed
Size: 3969 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110829/7c8f0e95/attachment.bin>


More information about the Mercurial-devel mailing list