Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Oct 2011 08:29:43 -0700 (PDT)
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Craig Rodrigues <rodrigc@crodrigues.org>
Cc:        Doug Barton <dougb@freebsd.org>, freebsd-current@freebsd.org
Subject:   Re: sys/conf/newvers.sh vs. subversion-1.7
Message-ID:  <alpine.BSF.2.00.1110220801140.38610@toaster.local>
In-Reply-To: <CAG=rPVeBQq5srTTjHDg-9Yc7R%2B5%2Buhm4BgzvhxEJ4KyN9ef%2B7w@mail.gmail.com>
References:  <20111020114844.GK59810@albert.catwhisker.org> <20111020122121.GL59810@albert.catwhisker.org> <201110211636.05917.jhb@freebsd.org> <20111021211221.GV59810@albert.catwhisker.org> <CAG=rPVfD8EZYpD_SQES2%2B9uUeqGOaAhW3asJbVeGKeV3er2ZKw@mail.gmail.com> <4EA21842.5000808@FreeBSD.org> <CAG=rPVeBQq5srTTjHDg-9Yc7R%2B5%2Buhm4BgzvhxEJ4KyN9ef%2B7w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Oct 2011, Craig Rodrigues wrote:

> Hi,
>
> I tried following:
>
> (1)   Run svnversion in non-svn directory:
>
>   return status == 0
>   prints out "exported"
>
> time:
> real    0m0.043s
> user    0m0.000s
> sys     0m0.045s
>
> (2)  Run svnversion in svn directory:
>
>   return status == 0
>   prints out "223847M"
>
> time:
> real    0m2.563s
> user    0m0.980s
> sys     0m1.187s
>
>
> (3)  Run "svn info --non-interactive  ." in non-svn directory:
>
>   return status == 1
>   prints out "svn: '.' is not a working copy"
>
> time:
>
> real    0m0.056s
> user    0m0.007s
> sys     0m0.046s
>
>
> (4)   Run "svn info --non-interactive ." in svn directory:
>
>    return status == 0
>    prints out "a bunch of info about from svn"
>
> time:
>
> real    0m0.023s
> user    0m0.000s
> sys     0m0.024s
>
>
>
> I thought that since svnversion seems to always have a return status of 0, and
> is almost 2 seconds slower than "svn info" when run inside a svn directory,
> that using "svn info" is a preferable way inside a script of determining
> if a directory is part of a svn repo or not.

$(svn info | awk '/^Revision:/ {print $2}')

is what I use in my installkernel wrapper script. Granted, I didn't know 
about svnversion some time later, but it appears that svnversion broke 
some things by consolidating the .svn directories as Chris shows above 
with the 'exported' line.

Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1110220801140.38610>