SVN TortoiseProc.exe : command to export the result displayed in Showcompare: - tortoisesvn

I am trying to automate our deployment process.
Question :- Am using this command to get modified files between trunk and working folder.
TortoiseProc.exe /command:showcompare /url1:C:\SVN\branches\Working_folder/folder1 /revision1:HEAD /url2:C:\SVN\trunk\folder1 /revision2:HEAD
With this command i get some midified file.
Now i want to export this list of files to my local C:\temp by using some command.
Please let me know if you need any other information.

TortoiseProc is User Interface tool; it doesn't print anything to stdout, so you cannot use this data.
Your only option is to use plain svn diff command with url to repositories and redirect your output to the file:
svn diff --summarize http://svn/branches/path_to_working_folder#HEAD http://svn/trunk/path_to_working_folder#HEAD > C:\temp\diff_results.txt
More about this command in here: http://svn.gnu.org.ua/svnbook/svn.ref.svn.c.diff.html

Related

SFTP - WinSCP: Zip a file/folder

I'm transferring a file to SFTP and then trying to zip it with WinSCP. It's not working.
After my put command, I'm using the following command.
zip -r "!?&SFTP Folder Path\MyFile.txt:?SFTP Folder Path\MyFile.zip!" !&
What am I doing wrong? What should I be doing? If I only want to zip a/any file with specific extension or folder, what changes do I make?
Update:
I'm getting the following log output after a file has been copied over to the sftp
...
batch continue Searching for host...
Connecting to host...
Authenticating...
Using username "admin". Authenticating with pre-entered password. Authenticated. Starting the session...
I'm using the following code after put cmd line.
option batch continue
call zip -r "/sftp folder/Myfile.zip" Myfile.csv
close
exit
Your syntax is a custom command. The custom commands is a GUI feature of WinSCP, it has nothing to do with the scripting.
In WinSCP scripting use the call command.
call zip -r /path/MyFile.zip file1.dat file2.dat ...
Though make sure you are allowed to execute shell commands on the server.

is it possible to put comments in a directory about a dir or file?

is it possible to put comments in a directory about a dir or file locally on my own machine, appearing in my terminal. I don't have any kind of GUI, so this would be helpful.
Maybe something like, when I do ls -l I will see:
file.txt #this is that file I made on tuesday
files #this is the directory I made with all those other files
If so, what is the tool to do it?
Is it available for Arch Linux?
Yes, there is a tool for that. It is called GIT or SVN.

get the current HEAD version of a CVS file on the server

Using the rlog command I can analyze the commit log to a file on the CVS server itself (that is, directly accessing the file ending in ",v"). That's fine.
Is there a similar command line utility that prints the current HEAD version of that file to stdout?
I need this for a custom CVS status utility (something like ViewVC, but made specifically for a certain repository) that will be written in PHP.
To print the content of the file that would be checked out, just use co -p filename. That will print a small header including the revision number to stderr, and the content of the file to stdout.
You probably want cvs log filename. Not sure buy you might need to do cvs update filename first.

Adding timestamp to a filename with mv in BASH

Well, I'm a linux newbie, and I'm having an issue with a simple bash script.
I've got a program that adds to a log file while it's running. Over time that log file gets huge. I'd like to create a startup script which will rename and move the log file before each run, effectively creating separate log files for each run of the program. Here's what I've got so far:
pastebin
DATE=$(date +"%Y%m%d%H%M")
mv server.log logs/$DATE.log
echo program
When run, I see this:
: command not found
program
When I cd to the logs directory and run dir, I see this:
201111211437\r.log\r
What's going on? I'm assuming there's some syntax issue I'm missing, but I can't seem to figure it out.
UPDATE: Thanks to shellter's comment below, I've found the problem to be due to the fact that I'm editing the .sh file in Notepad++ in windows, and then sending via ftp to the server, where I run the file via ssh. After running dos2unix on the file, it works.
New question: How can I save the file correctly in the first place, to avoid having to perform this fix every time I resend the file?
mv server.log logs/$(date -d "today" +"%Y%m%d%H%M").log
The few lines you posted from your script look okay to me. It's probably something a bit deeper.
You need to find which line is giving you this error. Add set -xv to the top of your script. This will print out the line number and the command that's being executed to STDERR. This will help you identify where in your script you're getting this particular error.
BTW, do you have a shebang at the top of your script? When I see something like this, I normally expect its an issue with the Shebang. For example, if you had #! /bin/bash on top, but your bash interpreter is located in /usr/bin/bash, you'll see this error.
EDIT
New question: How can I save the file correctly in the first place, to avoid having to perform this fix every time I resend the file?
Two ways:
Select the Edit->EOL Conversion->Unix Format menu item when you edit a file. Once it has the correct line endings, Notepad++ will keep them.
To make sure all new files have the correct line endings, go to the Settings->Preferences menu item, and pull up the Preferences dialog box. Select the New Document/Default Directory tab. Under New Document and Format, select the Unix radio button. Click the Close button.
A single line method within bash works like this.
[some out put] >$(date "+%Y.%m.%d-%H.%M.%S").ver
will create a file with a timestamp name with ver extension.
A working file listing snap shot to a date stamp file name as follows can show it working.
find . -type f -exec ls -la {} \; | cut -d ' ' -f 6- >$(date "+%Y.%m.%d-%H.%M.%S").ver
Of course
cat somefile.log > $(date "+%Y.%m.%d-%H.%M.%S").ver
or even simpler
ls > $(date "+%Y.%m.%d-%H.%M.%S").ver
I use this command for simple rotate a file:
mv output.log `date +%F`-output.log
In local folder I have 2019-09-25-output.log
Well, it's not a direct answer to your question, but there's a tool in GNU/Linux whose job is to rotate log files on regular basis, keeping old ones zipped up to a certain limit. It's logrotate
You can write your scripts in notepad but just make sure you convert them
using this ->
$ sed -i 's/\r$//' yourscripthere
I use it all they time when I'm working in cygwin and it works. Hope this helps
First, thanks for the answers above! They lead to my solution.
I added this alias to my .bashrc file:
alias now='date +%Y-%m-%d-%H.%M.%S'
Now when I want to put a time stamp on a file such as a build log I can do this:
mvn clean install | tee build-$(now).log
and I get a file name like:
build-2021-02-04-03.12.12.log

Access TortoiseSVN update text

When you use Tortoise SVN to update from the repository to your local machine, you get the popup that shows what files were added/updated/etc. I'm looking to get hold of that text programmatically.
Do you know if it's dumped to a temporary file or a log file? Or is there another way to get hold of that text? I can't see anything in the settings that provides for it.
One idea might be to use the svn.exe console program, like this
svn.exe log -r head -v <svn-dir>
-r means the revision (head being the newest)
-v being verbose (which includes the file names)
<svn-dir> is a dir that contains a svn checkout ( this can be omitted if you run the command inside such a dir).
There are also an -xml switch that might be useful if you want to massage the data in some way
This requires that you have a svn.exe in you path. It seems to be possible to find the svn.exe exec. here

Resources