VSS command-line merge doesn't launch diff tool - visual-sourcesafe

I've set VSS client up to use kdiff3 for 3-way merging, which is really useful. But when I use the command-line tool SS.exe, it is just making changes in the file. I'm merging trunk changes into my working branch, and VSS either replaces my branch changes with the trunk version, or marks every change in the branch as a conflict.
VSS won't let me merge into a branch in the IDE so this is my only option, but it doesn't work.

We gave up on using SS.exe manually, and just did the following:
In VS (2012) Go to tools and options.
Select Source Control in the left pane->configure User Tools (button) -> Add
Setup your comparison tool with the following data:
Extension: .*
Operation: Compare
Command: <location>\kdiff3.exe
Arguments: %1 --fname %6 %2 --fname %7
Setup your merging tool with the following data:
Extension: .*
Operation: Merge
Command: <location>\kdiff3.exe
Arguments: %3 --fname %8 %2 --fname %7 %1 --fname %6 -o %4
Now merges will work from IDE like a charm.

Related

Prevent JMeter from creating run log file when opening a test on Windows

I have followed the instructions from this StackOverflow answer which causes JMeter to be opened when double clicking on a .jmx file in Windows.
The problem is that when I open a .jmx file by double clicking on the file it automatically creates a JMeter log file (and names it [name_of_jmx_file].log, regardless of if you do anything with the test. The file is also not removed once you close JMeter, so I have to manually delete it each time.
This appears to be caused by the -j param in the following line from the default jmeter-t.cmd file:
call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9
Simply removing -j "%~n1.log" doesn't prevent the creation of the logfile as JMeter still creates the file and just defaults the name of the file to jmeter.log.
I have found a workaround which simply puts these auto-generated log files into a specific folder which I just periodically delete. This prevents the file from getting created in the same directory as the script which was the main inconvenience, though ideally I would like to figure out how to prevent the creation of this file entirely.
My workaround was to change the following line of the jmeter-t.cmd file:
call "%~dp0"jmeter -j "%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9
To this:
call "%~dp0"jmeter -j "C:\Users\[WINDOWS_USER]\Documents\JMeterRunLogs\%~n1.log" -t "%~nx1" %2 %3 %4 %5 %6 %7 %8 %9
There is log4j2.xml file in "bin" folder of your JMeter installation, if you look for this line:
<File name="jmeter-log" fileName="${sys:jmeter.logfile:-jmeter.log}" append="false">
and change ${sys:jmeter.logfile:-jmeter.log} to
C:\Users\[WINDOWS_USER]\Documents\JMeterRunLogs\jmeter.log
JMeter log file will always be generated under that folder no matter where you launch JMeter from.
More information:
Log4j - Log4j 2 Appenders, pay attention to FileAppender
How to Configure JMeter Logging

How to configure 3 way merge feature on compare in Visual Studio 2015

Problem: The default diff/ merge tool in visual studio 2015 (and previous versions) does not allow merging when you compare a file. It only allows you to see differences. The only occasion I'm aware of the 3 way merge option being enabled is when there is a merge conflict.
I want to see the 3 way merge option on every instance of the diff tool in Visual Studio.
Notes: I'm definitely not looking for an alternative tool or a 'work around' on this. I have been happily using WinMerge as my merge tool which allows merging anytime you compare. I really like the vs diff tool's 3 way option and being able to use it any time I want would be a nice boost to my work flow.
Thanks!
For anyone Googling Winmerge 3 way merging, Visual Studios settings for a merge are as follows:
Command: C:\Program Files (x86)\WinMerge\WinMergeU.exe
Arguments: /e /u /wl /dl %7 /dm %8 /dr %6 %2 %3 %1 %4
The above solution didn't work for me (I used WinMerge 2.16.2). In whatever way I ended the merge, Visual Studio said merge operation was cancelled. Final solution for me was to use /o argument:
/e /x /u /wl /dl %7 /dm %8 /wr /dr %6 %2 %3 %1 /o %4
Configuration is MINE BASE THEIRS
/x closes the compare if files are identical
/wr makes the right file readonly

Execute mutliple feature files in a project using specrun

Is there any way to execute multiple feature files within a project using specrun.exe
eg: I have a project Student, and I have the below feature files:
a.Maths
b.Biology
C.Chemistry
d.Physics.
Now I need to execute Maths and Physics together. How to do it?
For single feature file (Eg:Maths) the below command is working fine.
#pushd %~dp0
%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "Student.csproj"
#if ERRORLEVEL 1 goto end
#cd ..\packages\SpecRun.Runner.*\tools
#set profile=%1
#if "%profile%" == "" set profile=Default
SpecRun.exe run %~dp0\%profile%.srprofile "/baseFolder:%~dp0\bin\Debug" /log:specrun.log %2 /filter:testpath:Feature:Maths %4 %5
:end
#popd
Finally, I got the answer.
we have to exclude the feature files which we don't want to run.
The command that worked fine for me is as below
SpecRun.exe run %~dp0\%profile%.srprofile "/baseFolder:%~dp0\bin\Debug" /log:specrun.log "/filter:!testpath:Feature:Biology& !testpath:Feature:Chemistry"

Delete all .svn and .project files using windows registry

A the moment I have a registry file which delete the .svn files when right clicking over directory. I would like to extend this windows registry file to also delete some temporary files created from Zend Studio:
.buildpath
.project
.settings (directory)
Following the answers from this question: Windows batch file to delete .svn files and folders
I have:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
#="Delete SVN Folders"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
#="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" \""
I think this is what you are looking for. I only made changes to the last line.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN]
#="Delete SVN Folders"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command]
#="cmd.exe /c \"TITLE Removing SVN Folders in %1 && color 9A && for /r \"%~1\" %%F in (.) do (rd /s /q \"%%~fF\.svn\" \"%%~fF\.settings\" & del \"%%~fF\.buildpath\" \"%%~fF\.project\")2>nul \""
This solution is similar to what Laf was describing, except he suggested using && before the last command. I think that could give you problems because the next command would only execute if the RD was successful. But your current algorithm attempts to remove the directory from all subdirectories, even when it is not there. I used & so that the next command (DEL) always executes, regardless of the outcome of the RD. I extended the RD to delete both directories, and the added DEL command deletes both files.
I redirected stderr to nul so that you don't see a bunch of error messages. The algorithm is very inefficient and can generate a lot of error messages depending on the number of subdirectories.
If your requirements get any more complicated, or if you want to develop a more efficient script, you might be better off creating a batch file that does the work, and call the batch file from your registry entry. It's a bit messy to read and maintain a complicated set of commands on a single line. The escape sequences also become tiresome in the registry.
Some details on the command currently implemented:
cmd.exe /c: will call a new command interpreter, and execute the command that follows, then will quit (that's what /C does). The rest of the command (between the first and the last \" is the command that will be carried out by the command interpretter)
TITLE Removing SVN Folders in %1: Changes the title of the command interpreter to "Removing SVN Folders in folder".
COLOR 9A: changes the color scheme of your command interpreter
FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\": will delete all folders named .svn in the current folder.
%1 represent the folder on which you have right-clicked. The && between the commands means that the command interpreter will execute all three commands one after another. What you should do is to add your own command at the end of the command-line, like:
#="cmd.exe /c \"TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%f\" && *MyCommand*\""
where MyCommand is the command you need to delete the temporary files.

Subversion; checking out only trunk for multiple projects

I have a directory structure in svn like this:
Project A
branches
tags
trunk
Project B
branches
tags
trunk
...
I want to checkout only trunk directories for all these projects. There are about 400 of these kind of projects so checking out trunk manually won't be an option.
My first guess would be to use svn list, but my shell scripting skills are not up to par and I'm sure how to create the appropriate directories and append 'trunk' and do a checkout.
Anyone willing to point me in the right direction?
TL:DR;
svn list produces something like 'project_a'.
I want to checkout 'project_a/trunk' into 'project_a'.
You can store the list of projects to a file (projects_list), then run this script:
for p in $(cat projects_list); do
mkdir $p
svn co "$url/$p/trunk" $p
done
Here is a way to do it by using the depth flag:
echo Getting Projects the folder structure
svn co http://www.therepo.com/projectsParentFolder --depth immediates
echo Getting the structure for each Project
for /f %%f in ('dir /b .\projectsParentFolder') do svn co http://www.therepo.com/projectsParentFolder/%%f .\projectsParentFolder\%%f --depth immediates
echo Getting the trunk for each Project
for /f %%f in ('dir /b .\projectsParentFolder') do svn co http://www.therepo.com/projectsParentFolder/%%f/trunk .\projectsParentFolder\%%f\trunk --depth infinity

Resources