UNIX command/script svn log to get just the files information


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting UNIX command/script svn log to get just the files information
# 15  
Old 06-20-2013
Quote:
Originally Posted by iaav
Output from this: (just need the file info)

Batch/test.java
/HelloWorld
Batch/test.java
/HelloWorld
Is this the output you desire now?
# 16  
Old 06-20-2013
Did this:

Code:
svn log -v //test/svn/Demo/branches/HelloWorld/Batch --limit 2 | awk '$1~/^[AM]$/{for(i=2;i<=NF;i++)print $i}' | sed 's/\/branches\/HelloWorld\///g'

But do not wish to hard code the branch information. Any better way ?

---------- Post updated at 09:18 AM ---------- Previous update was at 09:15 AM ----------

Quote:
Originally Posted by Franklin52
Is this the output you desire now?
Franklin52:

Just this -
Code:
Batch/test.java
Batch/test.java

# 17  
Old 06-20-2013
Have you tried:
Code:
svn log......--limit 2 | awk -F/ 'NF>1 && /M \//{print $(NF-1) FS $NF}'

# 18  
Old 06-20-2013
I don't get the exact content of svn log file. So please let me assume that every line starting with "M" represents modification, every line starting with "A" represents adding, every line starting with "D" represents deletion, and what you need is the modification info.
You can write a script like this:
Code:
#!/bin/bash
#scriptname:get_chg_info
#usage: get_chg_info svn_dir
svn log -v $1 --limit 2 | grep '^M ' | gawk 'BEGIN{FS="[ /]";OFS="/"} {print $(NF-1),$NF}'

And you can use it like this:
Code:
#./get_chg_info //test/svn/Demo/branches/HelloWorld/Batch

hope it is useful for you.
# 19  
Old 06-20-2013
Quote:
Originally Posted by Franklin52
Have you tried:
Code:
svn log......--limit 2 | awk -F/ 'NF>1 && /M \//{print $(NF-1) FS $NF}'

tried this but it's restricted to file path if modified - 'M'. The path can also be 'A' or 'D'
# 20  
Old 06-20-2013
Quote:
Originally Posted by iaav
tried this but it's restricted to file path if modified - 'M'. The path can also be 'A' or 'D'
Try:
Code:
awk -F/ 'NF>1 && /[MAD] \//{print $(NF-1) FS $NF}'

# 21  
Old 06-20-2013
unix script to get just filename from the comment logs and exclude the branch information

Franklin - your command is right but my apologies i messed up the case right from beginning. Reposting the exact req now.

Need script help to get just the file info from svn logs - (using awk)

My svn log verbose:

Code:
svn log -v //test.com/svn/demo/branches/HelloWorld/ --limit 2
------------------------------------------------------------------------
r12 | testuser2 | 2013-05-29 15:09:20 -0400 (Wed, 29 May 2013) | 1 line
Changed paths:
   M /branches/HelloWorld/project/src/abc.java

ticket-2
------------------------------------------------------------------------
r11 | testuser1 | 2013-05-29 14:25:50 -0400 (Wed, 29 May 2013) | 1 line
Changed paths:
   A /branches/HelloWorld/helloworld.jar

ticket-1

Desired Output:
Code:
project/src/abc.java
helloworld.jar

Thanks !!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Making post down hook script for svn regarding sending emails after an file is committed in svn

Hi Folks , I am asking this question but i apologise please if this is not the correct forum , I have to develop a shell script that i want to place in at hooks/post-commit , that is basically i have to develop a post hook script and the main functionality of that script would be lets say if... (0 Replies)
Discussion started by: sunsun06060606
0 Replies

2. Shell Programming and Scripting

Get out of only Modified and Added files in svn log

How to get only modified and added files with revision,author and comments from svn log verbose ------------------------------------------------------------------------ r7351 | user01 | 2013-07-02 17:53:28 -0400 (Tue, 02 Jul 2013) | 2 lines Changed paths: D /trunk/demo/proj1/.project ... (1 Reply)
Discussion started by: iaav
1 Replies

3. Shell Programming and Scripting

Connect to SVN from UNIX

Hi, Can anyone please tell the command to connect to SVN from UNIX? Thanks (1 Reply)
Discussion started by: sampoorna
1 Replies

4. Shell Programming and Scripting

I want a script to view the complete log information of data stage job from UNIX IBM AIX.

Hi, I am working on data stage 8.7 version and I want a script a to view the all log information of the data stage job from UNIX environment. Can you please help me out by give the script. Thanks in advance... (7 Replies)
Discussion started by: victory
7 Replies

5. Shell Programming and Scripting

reading information from a table and apply a command on multiple files

Hey gyuz, I wanna calculate the number of mapped reads of a bam file in a region of interest. I used this code to do so : samtools view input.bam chrname:region1 > region1.txt This will store all the reads from given bam file within the region of interest in region1.txt Now I have... (5 Replies)
Discussion started by: @man
5 Replies

6. Solaris

How to integrate SVN client to SVN server repository.

Hi, I am new to SVN configuration on Solaris 10.I have installed SVN client version 1.7. bash-3.00# ./svn --version svn, version 1.7.4 (r1295709) compiled Mar 2 2012, 12:59:36 Here my requirement is how to integrate svn client to One of the SVN server repository. My repository... (0 Replies)
Discussion started by: muraliinfy04
0 Replies

7. UNIX for Advanced & Expert Users

SVN installation in UNIX

Hi all, I need ur help in installing SVN for unix. I am desperately need some helps on how to install SVN in unix. I have downloaded subversion-1.7.4.tar.gz . I have unzipped it and when i tried to ./configure it. I am unable to do so getting the error like "-bash: /.configure: No such... (5 Replies)
Discussion started by: dpak10
5 Replies

8. UNIX for Dummies Questions & Answers

PERL/UNIX - SVN check in command

I am working in perl. I need to do some svn check in from my server. I need to install svn in my server. I have the package "svn" in my server path How can I install that in my server. I tried , but this doesnt work. Can you please help with the command to be used. Thanks in... (0 Replies)
Discussion started by: irudayaraj
0 Replies

9. Ubuntu

Browsing folders getting SVN information

HI All I am newbie to Linux and Ubuntu. In Windows there is TortoiseSvnClient that makes possible to see ( while browsing a folder) whether a file is under source control with SVN or not ( green, red balloons on top of the file and question marks etc. ). Do you know if there is such product... (2 Replies)
Discussion started by: manustone
2 Replies
Login or Register to Ask a Question