Sponsored Content
Top Forums Shell Programming and Scripting gets all files details committed to svn by a particular user [or all users] since a particular date Post 302584127 by linuxadmin on Thursday 22nd of December 2011 08:46:46 AM
Old 12-22-2011
Tools gets all files details committed to svn by a particular user [or all users] since a particular date

Here is a shell for printing committed person's:
1. Revision number
2. Name
3. Date of commit
4. Files committed.
5. committing comment
6. Date


I just made for my usage. May be helpful for you too.

Do as follows.

create a file
$ vi svn_get_user_committed_files_details.sh
press i
then copy & paste the following as it is. And then make the shell executable with the command chmod.
[Don't forget to change PROJECT path. Smilie]

Usage :
$ sh svn_get_user_committed_files_details.sh anySvnUName
or
$ sh svn_get_user_committed_files_details.sh
Code:
#!/bin/bash
#######Things need to change######### [
PROJECT="/home/smily/workspace/MyProj"
#Date format should be YYYY-MM-DD
DateFrom="2011-12-20"
#DateTo can be in YYYY-MM-DD or HEAD
DateTo="HEAD"
#######Things need to change######### ]

svnfile_log_all="/tmp/svnfile_log_all.txt"
svnListUNames="/tmp/svnListUNames.txt"
svnUserCommitted="/tmp/svnUserCommitted.txt"
uName="$1"

[ $DateTo == "HEAD" ] && DateFromTo="-r {$DateFrom}:HEAD" || DateFromTo="-r {$DateFrom}:{$DateTo}"
[ -f $svnfile_log_all ] && rm -f $svnfile_log_all
[ -f $svnListUNames ] && rm -f $svnListUNames
[ -f $svnUserCommitted ] && rm -f $svnUserCommitted

echo -e "\nPlease wait..\n"
svn log $DateFromTo -v $PROJECT > $svnfile_log_all

if [ -z $uName ]; then
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./ {print user} ' | grep -v "^$" |sort | uniq >> $svnListUNames
else
  if [ `cat $svnfile_log_all | grep "$uName" | wc -l` -gt "0" ]; then
          echo $uName > $svnListUNames 
  else
          echo -e "\n>>>>>user: $uName not committed any files.<<<<<" 
          exit 0
  fi
fi

echo -e "\n\nRepo Name: `cat $PROJECT/.svn/entries | grep "http://" | head -1`" >> $svnUserCommitted

while read uName
do 
echo -e "\n$uName committed files\n======================" >> $svnUserCommitted
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' | grep -E "^   M|^   G|^   A|^   D|^   C|^   U" | awk '{print $2}' | sort >> $svnUserCommitted

echo -e "\n\nIn Detail:\n==========" >> $svnUserCommitted
cat $svnfile_log_all | awk -v uName=$uName '/^r[0-9]+ / {user=$3} /./{if (user==uName) {print}}' >> $svnUserCommitted
echo -e "\n"
done < $svnListUNames

echo -e "Log is in : $svnUserCommitted\n"
cat $svnUserCommitted

Changes / suggestions expected .. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Selecting files between a user inputed date range

Hi all! I'm working on a KSH script to select files between a user inputed date range (stored in a variable) and then move them and unzip them. I'm stuck at how to get the files between the user inputed date range selected. Any help would be greatly appreciated! The files are as such: ... (6 Replies)
Discussion started by: kelldan
6 Replies

2. Solaris

user logon details

how can i identifying whose are logged in last few days,time and date also want. what i will do for get that information (2 Replies)
Discussion started by: sijocg
2 Replies

3. Shell Programming and Scripting

SVN activity of certain user

Hi there, I'm looking for some help to get a little script done that shows me (or counts) only the added lines from an SVN repository of one specific user. Anybody has an idea? Thanks, Michael (0 Replies)
Discussion started by: MichaelGiese
0 Replies

4. Solaris

Command History for a user with IP details

Hi We are sharing our envoirnment with our component teams. the plateform is SunOS 5.8 Generic_117350-41 sun4u sparc SUNW,Sun-Fire-V490. All team logs in the domain with same user and perform activities. Now for the system auditing purpose can somebody guide me how can I get the details when... (6 Replies)
Discussion started by: sukhvinder_Tm
6 Replies

5. UNIX and Linux Applications

SVN user permissions trouble

I am trying to add a user to my SVN server that can only access one of about a dozen repositories I have set up. Here are the files that I think need changed and what I have set them to. No matter what I try with these files I am unable to see the results I am after. In the end I want this new... (0 Replies)
Discussion started by: benn600
0 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. Shell Programming and Scripting

To get the files in a directory for the given date (User entered date)

Need a ksh script to get the files that were created or modified in a directory on a particular date entered by the user. For example if a directory contains files as below : > ll total 41 -rw-rw-r-- 1 psn psn 199 Aug 23 07:06 psn_roll.sh -rw-rw-r-- 1 psn psn ... (10 Replies)
Discussion started by: ramprabhum
10 Replies

8. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (2 Replies)
Discussion started by: rehantayyab82
2 Replies

9. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code: archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (0 Replies)
Discussion started by: rehantayyab82
0 Replies

10. 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
JOURNAL_GET_UNDO_ACC(9) 				     The Linux Journalling API					   JOURNAL_GET_UNDO_ACC(9)

NAME
journal_get_undo_access - Notify intent to modify metadata with non-rewindable consequences SYNOPSIS
int journal_get_undo_access(handle_t * handle, struct buffer_head * bh); ARGUMENTS
handle transaction bh buffer to undo DESCRIPTION
Sometimes there is a need to distinguish between metadata which has been committed to disk and that which has not. The ext3fs code uses this for freeing and allocating space, we have to make sure that we do not reuse freed space until the deallocation has been committed, since if we overwrote that space we would make the delete un-rewindable in case of a crash. To deal with that, journal_get_undo_access requests write access to a buffer for parts of non-rewindable operations such as delete operations on the bitmaps. The journaling code must keep a copy of the buffer's contents prior to the undo_access call until such time as we know that the buffer has definitely been committed to disk. We never need to know which transaction the committed data is part of, buffers touched here are guaranteed to be dirtied later and so will be committed to a new transaction in due course, at which point we can discard the old committed data pointer. Returns error number or 0 on success. AUTHORS
Roger Gammans <rgammans@computer-surgery.co.uk> Author. Stephen Tweedie <sct@redhat.com> Author. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 JOURNAL_GET_UNDO_ACC(9)
All times are GMT -4. The time now is 06:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy