Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » [Patch] Clothes change
[Patch] Clothes change[message #236398] Sat, 31 October 2009 10:47 Go to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Another patch for people who can build stracciatella themselves.

In the tactical screen, press:
SHIFT + V to cycle the available vest palettes of the selected merc.
SHIFT + P to cycle the pants palettes.

It works for the civilians you escort too.

I did nothing in this patch, all the code was already there for a "Palette edit" screen. I have never seen it.

And, as a bonus, the 'j' key will let you climb roofs and jump fences, since I didn't bother to remove this part from the patch. 'j' is stolen from 1.13.

clothes_change.diff:
Index: Build/JAScreens.h
===================================================================
--- Build/JAScreens.h	(revision 7056)
+++ Build/JAScreens.h	(working copy)
@@ -4,7 +4,13 @@
 #include "ScreenIDs.h"
 #include "Types.h"
 
+/* mgl: Clothes change
+ * SOLDIERTYPE, resp PaletteRepID defined there
+ */
+#include "Soldier_Control.h"
+#include "Overhead_Types.h"
 
+
 ScreenID ErrorScreenHandle(void);
 
 ScreenID InitScreenHandle(void);
@@ -38,4 +44,10 @@
 ScreenID DemoExitScreenHandle(void);
 #endif
 
+/* mgl: Clothes change
+ * Exported function.
+ * It was a local function called by "PalEditScreenHandle()".
+ */
+void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal);
+
 #endif
Index: Build/JAScreens.cc
===================================================================
--- Build/JAScreens.cc	(revision 7056)
+++ Build/JAScreens.cc	(working copy)
@@ -285,7 +285,10 @@
 }
 
 
-static void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
+/* mgl: Clothes change
+ * Exported function.
+ */
+void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
 {
 	UINT8 ubPaletteRep = GetPaletteRepIndexFromID(pal);
 	const UINT8 ubType = gpPalRep[ubPaletteRep].ubType;
Index: Build/Tactical/Turn_Based_Input.cc
===================================================================
--- Build/Tactical/Turn_Based_Input.cc	(revision 7056)
+++ Build/Tactical/Turn_Based_Input.cc	(working copy)
@@ -1354,6 +1354,39 @@
 		case 'g': HandlePlayerTogglingLightEffects(TRUE);                      break;
 		case 'h': ShouldTheHelpScreenComeUp(HELP_SCREEN_TACTICAL, TRUE);       break;
 		case 'i': ToggleItemGlow(!gGameSettings.fOptions[TOPTION_GLOW_ITEMS]); break;
+		/* mgl: kbd shortcut 'j' = climb roof. From JA2 v1.13 */
+		case 'j':
+			{
+			SOLDIERTYPE* const s = GetSelectedMan();
+			if (!s) { break; }
+			
+			// Prevent the robot, Maria, Joey etc from climbing
+			if (!IsValidStance(s, ANIM_CROUCH)) { break; }
+				
+			// Make sure the merc is not collapsed!
+			if (s->bCollapsed && s->bBreath < OKBREATH)
+			{
+				// Merc can't change stance message
+				ScreenMsg(FONT_MCOLOR_LTYELLOW,
+				          MSG_UI_FEEDBACK,
+				          gzLateLocalizedString[3],
+				          s->name);
+				break;
+			}
+
+			if (FindHigherLevel(s))
+			{	 BeginSoldierClimbUpRoof(s);
+			}
+			else if (FindLowerLevel(s))
+			{ 	BeginSoldierClimbDownRoof(s);
+			}
+			else if (FindFenceJumpDirection(s))
+			{	 BeginSoldierClimbFence(s);
+			}
+
+			break;
+			} /* case 'j' */
+
 		case 'k': BeginKeyPanelFromKeyShortcut();                              break;
 
 		case 'l':
@@ -1561,6 +1594,18 @@
 			}
 			break;
 
+		/* mgl: Clothes change */
+		case 'v':
+		{
+		SOLDIERTYPE* const s = GetSelectedMan();
+		if (!s) { break; }
+		// Anyone except the robot can change clothes
+		if (AM_A_ROBOT(s)) { break; }
+		CyclePaletteReplacement(*s, s->VestPal);
+		break;
+		}
+
+
 #ifdef JA2BETAVERSION
 		case 'l':
 		{
@@ -1573,6 +1618,17 @@
 		}
 #endif
 
+		/* mgl: Clothes change */
+		case 'p':
+		{
+		SOLDIERTYPE* const s = GetSelectedMan();
+		if (!s) { break; }
+		// Anyone except the robot can change clothes
+		if (AM_A_ROBOT(s)) { break; }
+		CyclePaletteReplacement(*s, s->PantsPal);
+		break;
+		}
+		
 		case SDLK_F1:
 		case SDLK_F2:
 		case SDLK_F3:

Enjoy the trendy pink war vest.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #249335] Thu, 15 April 2010 00:15 Go to previous messageGo to next message
Centurion

 
Messages:80
Registered:April 2009
Location: E.U.

*don't want to continue the offtopic in that other thread:


I'm doing something wrong but I don't know if it's the *.diff file itself.


ok

1. Created a *.diff file using notepad++
2. pasted your code. resulted in = this file
3. placed file on c:\build
4. executed patch -p0 < clothes_change.diff

he says he can't find the file at input line 5 asks me to locate it

5. placed clothes_change.diff in c:\build\ja2 and executed it

(stripping trailing CRs from patch)
patching file Build/JAScreens.h
hunk#1 FAILED at 4
Hunk #2 failed at 44
2 out of 2 hunks FAILED -- saving rejects to file


"

***************
*** 285,291 ****
}


- static void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
{
UINT8 ubPaletteRep = GetPaletteRepIndexFromID(pal);
const UINT8 ubType = gpPalRep[ubPaletteRep].ubType;
--- 285,294 ----
}


+ /* mgl: Clothes change
+ * Exported function.
+ */
+ void CyclePaletteReplacement(SOLDIERTYPE& s, PaletteRepID pal)
{
UINT8 ubPaletteRep = GetPaletteRepIndexFromID(pal);
const UINT8 ubType = gpPalRep[ubPaletteRep].ubType;

Report message to a moderator

Corporal 1st Class
Re: [Patch] Clothes change[message #249402] Fri, 16 April 2010 00:28 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
It looks like "c:\build\ja2" is the right root of your stracciatella source code tree.

"patch.exe" fails on the first two changes of the ".diff" file and gives up without trying the rest of the file.

If you have the tools to do it, I suggest you try with two separate ".diff" files: one with Carriage Returns/Line Feeds (Windows) and one with Line Feeds only (Unix). If you used a computer on Windows to download the source code of stracciatella from the subversion repository, you should have CR/LF in the code and you should try a ".diff" file with CR/LF first. Try the other LF ".diff" file if it fails.

And I don't like that expression, quoted from your message:Quote:
(stripping trailing CRs from patch)
patching file Build/JAScreens.h
If there are CR/LF in your working copy of stracciatella, "patch.exe" shouldn't try to remove CR/LF from your diff file. See if you have a command line option to prevent "patch.exe" from doing this.
Try to type:
patch.exe -h
and see if it prints some help on the screen.

An other possibility is that the line numbers don't match anymore in the source code between svn revision 7056 (on wich the ".diff" file was done) and rev 7059. I will check that and answer later.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #249451] Fri, 16 April 2010 13:58 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
I can tell I have the same errors as you on my Linux box when I try to patch a source code file with:
- the diff file in LF (Linux native) format
- the source code file in CR/LF (Windows) format.

Surprisingly, the same error still happens with:
- diff in CR/LF
- source in CR/LF too

It works only when both files are in the native (LF) text format.

I don't know if, on Windows, diff/patch would work if all the files are in the native CR/LF format, or if they would work only in LF format like on Unix systems.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #249463] Fri, 16 April 2010 15:45 Go to previous messageGo to next message
Centurion

 
Messages:80
Registered:April 2009
Location: E.U.

yeah getting it to work would be sweet but since I don't have access to a linux os that won't happen Sad

Report message to a moderator

Corporal 1st Class
Re: [Patch] Clothes change[message #249501] Fri, 16 April 2010 20:17 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
You can do a desperate try with the "--binary" command line option on a CR/LF diff file and CR/LF source code files:
patch -p0 --verbose --binary --dry-run < clothes_change.diff

The "--dry-run" option will make the patch program simulate the update without really updating anything and the "verbose" option will show more output. See if it looks better.

Another solution is to have your source code tree in Unix LF text format. The only change is that Windows editors will display source code files on a single line. You can convert them by hand with tools like unix2dos/dos2unix or todos/fromdos but it may not be reasonable to do it on the many (4 ?) source code files that the "change_clothes" patch updates.

You would rather edit your subversion configuration file and change the svn:eol-style property to have this:
### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   
### 
### 
### 
### 
*.c = svn:eol-style=LF
*.cpp = svn:eol-style=LF
*.h = svn:eol-style=LF
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=LF
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=LF

LF for all the source files: *.h, *.cpp and *.c (I doubt there are still .c files in stracciatella).
If you use TortoiseSVN, it's in the menu TortoiseSVN->Settings, where you have a button "Edit Subversion configuration file". The next time you check out from Mythrell's or Tron's repositories, your source code files will be converted to Unix text file format.

To check that it would work, if you wish, instead of the bigger "Clothes change" patch, try on this content before you update your subversion configuration file:

Jake_sells_CAWS_ammo.diff:
Index: Build/Tactical/Arms_Dealer_Init.cc
===================================================================
--- Build/Tactical/Arms_Dealer_Init.cc	(revision 7059)
+++ Build/Tactical/Arms_Dealer_Init.cc	(working copy)
@@ -498,6 +498,16 @@
 		// gas is restocked regularly, unlike most items
 		GuaranteeAtLeastXItemsOfIndex( ARMS_DEALER_JAKE, GAS_CAN, ( UINT8 ) ( 4 + Random( 3 ) ) );
 	}
+	
+	/* mgl: Jake sells CAWS ammo if Maddog was recruited */
+	if (gMercProfiles[MADDOG].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED)
+	{
+		GuaranteeAtLeastXItemsOfIndex(ARMS_DEALER_JAKE,
+		                              Random(2) ? CLIPCAWS_10_SAP
+		                                        : CLIPCAWS_10_FLECH,
+		                              1 + Random(3)
+		                             );
+	}
 
 	//If the player hasn't bought a video camera from Franz yet, make sure Franz has one to sell
 	if( !( gArmsDealerStatus[ ARMS_DEALER_FRANZ ].ubSpecificDealerFlags & ARMS_DEALER_FLAG__FRANZ_HAS_SOLD_VIDEO_CAMERA_TO_PLAYER ) )

This patch is only two lines of code and updates only one file: 'Build/Tactical/Arms_Dealer_Init.cc'.
It makes Jake start to sell clips for the CAWS if you hire Maddog.

You should copy and paste this content to a file 'Jake_sells_CAWS_ammo.diff' at the root of your straciatella source tree as either a CR/LF or LF only text file.

Convert the source code file 'Build/Tactical/Arms_Dealer_Init.cc' to Unix (LF) format with the tool of your choice. As a tip, it should be smaller than originally when converted to unix text format.

Now that you have the diff file in any format and the source code file in LF format, cd to the root of your straciatella tree and type:
patch -p0 --verbose --dry-run < Jake_sells_CAWS_ammo.diff
And watch if it would fail or not. Try to change the text format of the diff file if it fails.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #249508] Fri, 16 April 2010 21:20 Go to previous messageGo to next message
Centurion

 
Messages:80
Registered:April 2009
Location: E.U.

no *.c files only *.cc


I don't need to mess with the source code in windows so I will try that method of downloading the source like it was linux


I'll setup turtle SVN to download the source with the linux options and then compile with that command

I'll let you know how it works but it probably won't work since your compiling in windows with linux things

Report message to a moderator

Corporal 1st Class
Re: [Patch] Clothes change[message #249510] Fri, 16 April 2010 21:52 Go to previous messageGo to next message
Mythrell is currently offline Mythrell

 
Messages:78
Registered:May 2008
Location: Mikkeli, Finland
I myself use windows as well, so I know that these line endings can be a bit tough.

You can automaticly alter line endings to be one of these, for example Ultra Edit or Notepad++ (notepad++ is freeware, handy to have) can do this easily. They can also show it to you if you put on "show everything".

What really annoys the stuff out of me is that even when SVN will translate whole file line endings, if you mix both in same file it won't work.

Currently I'm not even 100% they all are in "linux" format. I hope they are Smile




Report message to a moderator

Corporal
Re: [Patch] Clothes change[message #249556] Sat, 17 April 2010 18:27 Go to previous messageGo to next message
Centurion

 
Messages:80
Registered:April 2009
Location: E.U.

Mythrelll now I understand why the question irritated you


in my defense I didnt know it was so complicated....


setting SVN to linux files is also a fail



I believe the only, last option, to make this work is for this to be patched in a linux system then have the source code converted to dos then compile the source code in windows :/



I have open solaris cd but don't think im going to install it just for this I think I may have to go without this patch

Report message to a moderator

Corporal 1st Class
Re: [Patch] Clothes change[message #249568] Sat, 17 April 2010 21:43 Go to previous messageGo to next message
lockie is currently offline lockie

 
Messages:3717
Registered:February 2006
Location: Scotland
Quote:
Poster: Centurion


You still here , and is an apology out of the question for your rudeness ?

Report message to a moderator

Captain

Re: [Patch] Clothes change[message #249583] Sat, 17 April 2010 22:45 Go to previous messageGo to next message
cdudau
A littler humor from Burzmali:

http://www.sniffpetrol.com/wp-content/uploads/spad_moderator.jpg

Report message to a moderator

Re: [Patch] Clothes change[message #249585] Sat, 17 April 2010 23:47 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
The ash cloud is on my thread...
Thanks for your input, guys.
Say one "Flower of Scotland" each to be forgiven.


Centurion
setting SVN to linux files is also a fail

You must fetch the svn archive once its done, and also enable the auto-prop section before that in the subversion configuration file.


Centurion
I believe the only, last option, to make this work is for this to be patched in a linux system then have the source code converted to dos then compile the source code in windows :/

No, do the test I suggested on the CAWS patch when you have some time to waste:
- Edit 'Build/Tactical/Arms_Dealer_Init.cc' with Notepad++ as Mythrell suggested and find a way to save it as a unix file (with LF endlines only).
- Save the content of 'Jake_sells_CAWS_ammo.diff' with CR/LF (Windows native)
because the doc of the GNU patch for Windows says it needs a diff file with CR/LF (while the doc of patch says it will strip the CR code from the diff file!)
- Run patch

Then we will know if it really doesn't work.

You are my only tester, so I count on you. I myself gave up installing a MSYS/Mingw environment on my Windows computer a long time ago.
Why do things have to be so painful on Windows ?

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #249599] Sun, 18 April 2010 10:19 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Ok, I dusted out my old MSYS/Mingw on Windows (on which I was never able to even compile SDL) and tried the "Jake sells ammo for the CAWS" patch.

My patch program version is 2.5, not the current 2.5.9

- The diff file is saved as a CR/LF text file (i.e Windows native)
- The source code file is a CR/LF text file too

$ patch -p0 --verbose < Jake_CAWS.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: Build/Tactical/Arms_Dealer_Init.cc
|===================================================================
|--- Build/Tactical/Arms_Dealer_Init.cc	(revision 7059)
|+++ Build/Tactical/Arms_Dealer_Init.cc	(working copy)
--------------------------
Patching file `Build/Tactical/Arms_Dealer_Init.cc' using Plan A...
Hunk #1 succeeded at 498.
done

As you can see, it works.
After the patch is done, the whole source code file 'Build/Tactical/Arms_Dealer_Init.cc' is converted to a unix text file (with LF only) though.

Then I tried with the same diff file but with a source code file in LF text format and it worked too.

I tried all the possible combines on the diff file and the source code file and GNU patch 2.5 worked in any case, even better than what I have on Linux with patch 2.5.9. It still possible that the current GNU patch version is buggy (since its release in 2007!).



Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #249609] Sun, 18 April 2010 14:38 Go to previous messageGo to next message
Centurion

 
Messages:80
Registered:April 2009
Location: E.U.

oh wait


it worked even on a mix CR/LF


?


I don't get this... wait -> notepad++ doesn't give me the option to decide in which format to save the *.diff

it just says *.diff *.patch


can you upload your clothes_change.diff file

http://www.megaupload.com/


I'll try to use your file that is clearly LF and see what happens in both source code (one downloaded in lf)

Report message to a moderator

Corporal 1st Class
Re: [Patch] Clothes change[message #249622] Sun, 18 April 2010 19:35 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Centurion
notepad++ doesn't give me the option to decide in which format to save the *.diff

it just says *.diff *.patch

* Load your diff file in Notepad++

* On the menu bar, click "View->Show Symbol->Show end of line" to see the newlines.
You should see a lot of CRLF now.

* On the menu bar, click "Edit->EOL conversion->Unix format".
LF symbols should now replace the former CRLF symbols. Your file is in Unix text format.

* Save your file and don't let a Windows tool mess with it.

Centurion
can you upload your clothes_change.diff file

I could, but I suspect Windows will convert it back to its native CRLF as soon as you will use one of its tools like "Drag and drop" it in the explorer.

In my old MSYS window, I have the "dos2unix" and "unix2dos" programs to convert formats. It looks like they were installed by MSYS itself, you may have them too.

$ dos2unix Jake_CAWS.diff
dos2unix: converting file Jake_CAWS.diff to UNIX format ...

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #250204] Sun, 25 April 2010 00:10 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
I just noticed that TortoiseSVN on Windows has an "Apply patch" menu...

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #250945] Tue, 04 May 2010 10:52 Go to previous messageGo to next message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
mgl
Another solution is to have your source code tree in Unix LF text format. The only change is that Windows editors will display source code files on a single line. You can convert them by hand with tools like unix2dos/dos2unix or todos/fromdos but it may not be reasonable to do it on the many (4 ?) source code files that the "change_clothes" patch updates.

You would rather edit your subversion configuration file and change the svn:eol-style property to have this:
### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   
### 
### 
### 
### 
*.c = svn:eol-style=LF
*.cpp = svn:eol-style=LF
*.h = svn:eol-style=LF
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=LF
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=LF

LF for all the source files: *.h, *.cpp and *.c (I doubt there are still .c files in stracciatella).
If you use TortoiseSVN, it's in the menu TortoiseSVN->Settings, where you have a button "Edit Subversion configuration file". The next time you check out from Mythrell's or Tron's repositories, your source code files will be converted to Unix text file format.


This has absolutely not effect on your side. Automatic properties only affect new files added to the repository. E.g. if you "svn add foo.c" it automatically gets the property svn:eol-style with value LF (according to your config) set.

Report message to a moderator

Sergeant 1st Class
Re: [Patch] Clothes change[message #250966] Tue, 04 May 2010 23:24 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Tron
This has absolutely not effect on your side.

I forgot to tell that you must trash your working copy and check out the whole repository after you edited the configuration file ??
I hope people who want to do that realize that I forgot to add a line for ".cc" files in the configuration file, or they will have to trash their working copy and check out the repository again Wink

The GNU patch program I used on Windows works with the diff file and source code files in CRLF text format. No-one should use the unfriendly svn checkout method to convert his files.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #250976] Wed, 05 May 2010 08:26 Go to previous messageGo to next message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
mgl
Tron
This has absolutely not effect on your side.

I forgot to tell that you must trash your working copy and check out the whole repository after you edited the configuration file ??
I hope people who want to do that realize that I forgot to add a line for ".cc" files in the configuration file, or they will have to trash their working copy and check out the repository again Wink


No, it has no effect, no matter whether you check out from the repository again or not. Please re-read my last post and/or the respective chapters in the Subversion book (automatic property setting and effect of eol-style).

Report message to a moderator

Sergeant 1st Class
Re: [Patch] Clothes change[message #251034] Thu, 06 May 2010 22:20 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
You're right. I took some time to read the docs and they say it works for check ins only.

I did some tests too: I copied my working copy from Linux on a USB mass storage device and updated it on Windows. All the updated files, which were in unix LF text format, are now in Windows native CRLF format while the others are still in unix text format. There is no consistency on the client side of subversion. If I had to patch one of those updated files on Linux, GNU patch would fail without giving a clue. It seems it would no be a good idea to use subversion when you travel with your working copy and have to use another computer.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #251708] Sun, 16 May 2010 21:43 Go to previous messageGo to next message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
The behaviour is simple: When "svn:eol-style" is set to "CRLF" for one file, you always get lines ending in carriage return and line feed when checking out this file. With "LF" you always get just line feeds. When it is set to "native" you get the native line ending for your machine, e.g. LF on Unix and CRLF on Windows, when checking out this file.

Report message to a moderator

Sergeant 1st Class
Re: [Patch] Clothes change[message #251713] Sun, 16 May 2010 22:52 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
I hope you meant check in.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #251716] Sun, 16 May 2010 23:05 Go to previous messageGo to next message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
No. See End-of-Line Character Sequences.

Report message to a moderator

Sergeant 1st Class
Re: [Patch] Clothes change[message #251719] Sun, 16 May 2010 23:38 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
You just said the opposite in your previous post and my tests with TortoiseSVN on Windows (on which I am not very gifted) seconded what you said.

*Edit*
It must be because the files I used came from Linux with their eol property already set to native.

It's too late for a street slaughter today. I will wait tomorrow and go downtown with my trusted nail cutter. It will be a blood bath!

[Updated on: Sun, 16 May 2010 23:49] by Moderator

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #251721] Mon, 17 May 2010 00:03 Go to previous messageGo to next message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
mgl
You just said the opposite in your previous post

No, I didn't. The two posts refer to two different things: Automatically setting the property using autoprops only happens when adding the file. On the other hand, you see the effect of the property when checking out the file.

Quote:
*Edit*
It must be because the files I used came from Linux with their eol property already set to native.

The property svn:eol-style is set to "native", because I set it when adding the files to the repo. This is independent where you check out the files. But the effect of "native" depends on where you check out: If you check out a file, which has svn:eol-tyle set to native, from the repo on a Linux box, then you get line feeds as line endings. If you check out the same file on a Windows box, then you get carriage return+line feed. That's the meaning of native: You get the native line endings for the machine you are doing the checkout on.
Of course, if you do a checkout on a Linux box onto an USB stick and later put that stick into a Windows box, the files will still have line feeds as line endings. Moving the stick does not magically change the line endings. Probably doing operations with SVN on this checkout on the Windows box might change the line endings of the touched files.

Report message to a moderator

Sergeant 1st Class
Re: [Patch] Clothes change[message #251723] Mon, 17 May 2010 00:44 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Tron
Probably doing operations with SVN on this checkout on the Windows box might change the line endings of the touched files.

All the updated files in r7063 had CRLF. All the others kept their LF format of course.

I did the following test on "AniviewScreen.cc" on the same USK disk with TortoiseSVN on Windows:
It's originally in LF format with its eol property set to "native".
I changed its eol property to "CRLF", removed the file and checked it out.
It was in CRLF format.
I changed its property to LF, removed it again and checked it out.
It was in LF format.
Nice.

If I want to have all my updated files in LF text format whatever the computer I'm on, it seems I only have to set their eol property to LF.

Report message to a moderator

Master Sergeant
Re: [Patch] Clothes change[message #251736] Mon, 17 May 2010 07:16 Go to previous message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
You can change svn:eol-style manually (which, of course, makes your working copy modified), but there is no point. Just leave it at native: You correctly get line feeds on Linux and carriage return + line feed on Windows.
Your problem just stems from the fact that you moved a working copy from one machine to another. Probably just removing a file and checking it out again does the trick (i.e. leave out changing svn:eol-style). The point of the "native" setting is, that there is no need for you to change anything. You simply get The Right Thing(TM) for the machine you are working on.

Report message to a moderator

Sergeant 1st Class
Previous Topic: [Patch] Skip militia turns by holding SHIFT
Next Topic: can ja2 stracciatella support other format music???
Goto Forum:
  


Current Time: Fri Jan 10 20:43:08 GMT+2 2025

Total time taken to generate the page: 0.02285 seconds