[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] 'svn st -v' looks weird on an empty repository (Issue:708)

From: Jilles Oldenbeuving <ojilles_at_hotmail.com>
Date: 2003-07-26 15:46:41 CEST

/* This is my first (oh maybe my second) patch submission. I've
 * read all in HACKING, etc. So please, if I skip on some
 * rules (written or not) please tell me, i'll adapt my patch */

So, thanks to Shlomi Fish, i've rewritten this patch so that it now
correctly determines wether or not the repository is empty. This is done by
first determining the number of files/directories under version control in
current directory. If this is > 0, bail out. Otherwise do the same for the
parent directory. If this returns either a count of 0 or an error, the
repository is empty and a helpfull message is displayed to the user.

Anyway, typical output with this patch looks like:

    # on a really empty repository:
    jilles@lorien:~/empty_reptest$ svn st -v
                    0 ? ? .
    The repository is empty.
    jilles@lorien:~/empty_reptest$ touch unversioned_file
    jilles@lorien:~/empty_reptest$ svn st -v
                    0 ? ? .
    ? unversioned_file
    The repository is empty.

    # on a repository that had some files in it,
    # but not anymore:
    jilles@lorien:~/is_empty_again$ svn st -v
                    2 2 jilles .
    The repository is empty.

    # on a repository that does have files, and
    # also on an empty subdirectory:
    jilles@lorien:~/filled_rep$ svn st -v
                    1 1 jilles .
                    1 1 jilles hoi
                    2 2 jilles versioneddir
    jilles@lorien:~/filled_rep$ cd versioneddir/
    jilles@lorien:~/filled_rep/versioneddir$ svn st -v
                    2 2 jilles .

So this is the intended behavior. I've attached the patch
because it contained a ^L that looked funny in my news
client, so I wanted to be on the save side.

Thanks for all the help,

Jilles Oldenbeuving


Fix issue #708: 'svn st -v' looks weird on an empty repository

* status.c
  (svn_cl__print_status_list): Fixed issue #708. If the repository
  is empty do not show the "0 0 ?" but print a message for
  the user pointing out that the repository is empty. (This only
  works when the verbose option (-v) is passed to the client.)

  (svn_cl__repos_empty): New Function.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sun Jul 27 03:23:17 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.