Issue1077

Title transplant does not work on Windows
Priority bug Status chatting
Superseder Nosy List jglick, kamitchell, pmezard
Assigned To Topics windows

Created on 2008-04-04.18:53:06 by jglick, last changed 2008-05-30.14:15:25 by kamitchell.

Messages
msg5831 (view) Author: pmezard Date: 2008-04-04.21:50:25
You are right about the transplant case, I was generalizing too fast
msg5829 (view) Author: jglick Date: 2008-04-04.21:08:34
I still disagree; the current behavior is unconditionally incorrect. If there is
a changeset in one repository that I am trying to transplant to another
repository, and there is no inherent reason for a merge conflict to arise,
Mercurial should just do it. What newline convention I happen to using for
checked-out files should be completely irrelevant; the files in the repository
storage are in LF format in the old and new revisions and I want the exact same
change applied in the new changeset. I did not ask to have anything done to my
checked-out files beyond whatever would happen upon running 'hg up' if someone
else had done the transplant on my behalf. If Hg even requires me to have a
checkout at all when running the transplant command, that should be just an
artifact of the command's implementation.
msg5828 (view) Author: pmezard Date: 2008-04-04.20:49:39
> Windows users expect that their text files will be present on disk in CRLF
format and that all version control operations work transparently under that
assumption.

Well, as a former Windows user working on Mercurial sources (LF only), I
disagree. I often move files back or forward with MacOSX and do not want to
think about CRLF conversions. I expect my files to be in whatever line-endings
is enforced by the project I am working on.

I agree the behaviour you describe should be made *really* easy to configure and
Windows packager may enable it by default. But correctness wrt line-endings is
valuable.
msg5827 (view) Author: jglick Date: 2008-04-04.20:35:31
I don't think you should need to set a special option just to make transplant or
other patch-based operations work. Windows users expect that their text files
will be present on disk in CRLF format and that all version control operations
work transparently under that assumption.
msg5826 (view) Author: pmezard Date: 2008-04-04.20:25:04
Yes, win32text definitely breaks a lot of tools including transplant and mq.

One possibility is to add a patch option to decide how strict should be line
endings handling. In strict mode (default current mode), line endings are
preserved. Otherwise, line endings are sampled from target file, then target and
patch ones are unified to the sampled value. If mixed line endings are found in
target, just bail out.

What do you think ?
msg5824 (view) Author: jglick Date: 2008-04-04.18:53:03
Using Hg 1.0 on XP, with mercurial.ini specifying

[encode]
{}**=cleverencode:
[decode]
{}**=cleverdecode:

if you make a trivial repository with one file and three revisions (the two
diffs being in different areas of the file), clone from the first revision into
another, cd to the other, and run

hg transplant -s ..\original 2

you will just get a *.rej file and the transplant will fail.

I know of no such problem on Linux, so I am assuming that usage of win32text is
to blame.
History
Date User Action Args
2008-05-30 14:15:25kamitchellsetnosy: + kamitchell
2008-04-04 21:50:25pmezardsetnosy: pmezard, jglick
messages: + msg5831
2008-04-04 21:08:41jglicksetnosy: pmezard, jglick
messages: + msg5829
2008-04-04 20:49:42pmezardsetnosy: pmezard, jglick
messages: + msg5828
2008-04-04 20:35:31jglicksetnosy: pmezard, jglick
messages: + msg5827
2008-04-04 20:25:04pmezardsetstatus: unread -> chatting
nosy: + pmezard
messages: + msg5826
2008-04-04 18:53:06jglickcreate