Login | Register
My pages Projects Community openCollabNet

Discussions > users [DISABLED] > svnlook cat -t $TXN $REPO broken ?

subversion
Discussion topic

There will be a brief maintenance window every Friday at 17:00 Pacific.
For further details, see CollabNet's maintenance and upgrade policy.

Back to topic list

svnlook cat -t $TXN $REPO broken ?

Author pcpinkerton
Full name Phil Pinkerton
Date 2009-09-25 11:32:49 PDT
Message Seems that trying to create a pre-commit hook script that limits the size of
a file to be committed is not an easy task.

svnlook has been recommended but I have yet to see it work properly the "-t"
option does not seem to find the transaction.

svnlook cat -t $TXN $REPO always returns an error

# Check file size. do not allow Access files greater than 1MB.
    REPOS=$1
    TXN=$2
    SVNLOOK=/svn/bin/svnlook

    # get a list of all the files changed
    $SVNLOOK changed -t "$TXN" "$REPOS" | while read type file
    do
        # skip all the files unless they end in .mdb
        [ ${file##*.} != "mdb" ] && continue #Skip unless a .mdb suffix
        # I cat out the file and then count the characters.
        # If it is greater than 1mb, I put it in my error array.
        # Is there a better way to get the size of a file w/ svnlook?
                       if [ $($SVNLOOK cat -t "$TXN" "$REPOS" $file | wc
-c) -ge "1000000" ]
error here ?? ^^^^^^^^^^^^^^^^^^^^​^^^^^^^^^^^^^^^^^^^^​^^^^^^^^^^^^^^^^
        then
           $error["$file"]=""$file: We can't commit Access databases larger
than 1mb"
        fi
    done

--
" The fundamental principle here is that the justification for a physical
concept lies exclusively in its clear and unambiguous relation to the facts
that it can be experienced" AE

Please Feed and Educate the Children... it's the least any of us can do.
Attachments

« Previous message in topic | 1 of 2 | Next message in topic »

Messages

Show all messages in topic

svnlook cat -t $TXN $REPO broken ? pcpinkerton Phil Pinkerton 2009-09-25 11:32:49 PDT
     Re: svnlook cat -t $TXN $REPO broken ? eichin Mark Eichin 2009-09-25 13:22:11 PDT
Messages per page: