[FFmpeg-devel] [PATCH] Read "Last Changed Rev" field as version info.

Måns Rullgård mans
Fri Jan 15 23:53:27 CET 2010


Ramiro Polla <ramiro.polla at gmail.com> writes:

> Hi,
>
> Read "Last Changed Rev" field instead of "Revision" field to avoid
> being affected by changes in other directories (such as branches).
> This will be more useful for getting swscale revision that isn't
> affected by other commits to mplayer.
>
> I tested on subversion 1.3 for the old .svn/entries format, but I left
> out the new .svn/entries format because I'm not that skilled with sed
> and I don't know how reliable it would be to get the nth line after
> "dir".

Why do we look for the revision in so many ways?  Does "svn info"
sometimes fail?

> Ramiro Polla
>
> From 3b3b7d17b6cd780cf47341df38e0c5c71474f87c Mon Sep 17 00:00:00 2001
> From: Ramiro Polla <ramiro at arrozcru.(none)>
> Date: Thu, 7 Jan 2010 15:37:16 -0200
> Subject: [PATCH] Read "Last Changed Rev" field instead of "Revision" field to avoid being
>  affected by changes in other directories (such as branches).
>
> ---
>  version.sh |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/version.sh b/version.sh
> index c86919d..e2727e3 100755
> --- a/version.sh
> +++ b/version.sh
> @@ -2,8 +2,8 @@
>  
>  # check for SVN revision number
>  revision=$(cat snapshot_version 2> /dev/null)
> -test $revision || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
> -test $revision || revision=$(cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2)
> +test $revision || revision=$(cd "$1" && LC_ALL=C svn info 2> /dev/null | grep "Last Changed Rev" | cut -d' ' -f4)
> +test $revision || revision=$(cd "$1" && grep committed-rev .svn/entries 2>/dev/null | head -n 1 | cut -d '"' -f2)
>  test $revision || revision=$(cd "$1" && sed -n -e '/^dir$/{n
>  p
>  q
> -- 
> 1.6.0.4

Looks OK as such, but I'd like an answer to the above question (not
necessarily from you).

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list