Don't show svn:externals in svn status

前端 未结 3 1353
被撕碎了的回忆
被撕碎了的回忆 2021-02-12 10:37

I\'ve made one svn:external in my repository. Everything works fine, except the output of the svn status command. In the output there is lot of informa

3条回答
  •  情深已故
    2021-02-12 11:08

    Searching turns up a clever Bash script implementation that overrides the svn command with a script. However, I wanted to do something similar in Windows. Remove the svn directory from your PATH, then create a batch script named svn.bat and put it somewhere in your PATH (like C:\Windows):

    @echo off
    setlocal
    
    if (%1)==(st) goto :match
    if (%1)==(stat) goto :match
    if (%1)==(status) goto :match
    
    :: If not running Status command, just pass the args along
    "C:\Program Files\SlikSvn\bin\svn" %*
    goto :eof
    
    :match
    
    :: Init variables
    set svnargs1=
    set svnargs2=--ignore-externals
    
    :: Loop through arguments
    :loop
    if "%~1"=="" goto :cont
    
    :: Look for ignore externals flag
    if "%~1"=="--examine-externals" (
        set svnargs2=
    ) else (
        if "%~1"=="-h" (
            set svnargs2=
        )
    
        set svnargs1=%svnargs1% %1%
    )
    
    
    shift & goto :loop
    :cont
    
    :: Call svn
    "C:\Program Files\SlikSvn\bin\svn" %svnargs1% %svnargs2%
    

提交回复
热议问题