svn list of files that are modified in local copy

久未见 提交于 2019-12-20 09:09:05

问题


I use Tortoise client to checkout/commit my changes to SVN. But I found this little difficult because I'm not able to find List of all files that are changed in my local copy. Is there any short cut or something that I overlooked?

I'm new to SVN. FYI.


回答1:


The "Check for Modifications" command in tortoise will display a list of all changed files in the working copy. "Commit" will show all changed files as well (that you can then commit). "Revert" will also show changed files (that you can then revert).




回答2:


I'm not familiar with tortoise, but with subversion to linux i would type

svn status

Some googling tells me that tortoise also supports commandline commandos, try svn status in the folder that contains the svn repository.




回答3:


I couldn't get svn status -q to work. Assuming you are on a linux box, to see only the files that are modified, run: svn status | grep 'M ' On windows I am not sure what you would do, maybe something with 'FindStr'




回答4:


Below command will display the modfied files alone in windows.

svn status | findstr "^M"



回答5:


If you really want to list modified files only you can reduce the output of svn st by leading "M" that indicates a file has been modified. I would do this like that:

svn st | grep ^M



回答6:


svn status | grep 'M ' works fine on MacOSX.

I just tested this.




回答7:


If you only want the filenames and also want any files that have been added (A).

svn st | grep ^[AM] | cut -c9-

Note: The first 7 columns are each one character wide followed by a space then the filename.




回答8:


this should do it in Windows: svn stat | find "M"




回答9:


svn status | grep ^M will list files which are modified. M - stands for modified :)




回答10:


As said you have to use SVN Check for modification in GUI and tortoiseproc.exe /command:repostatus /path:"<path-to-version-control-file-or-directory>" in CLI to see changes related to the root of the <path-to-version-control-file-or-directory>.

Sadly, but this command won't show ALL local changes, it does show only those changes which are related to the requested directory root. The changes taken separately, like standalone checkouts or orphan external directories in the root subdirectory will be shown as Unversioned or Nested and you might miss to commit/lookup them.

To avoid such condition you have to either call to tortoiseproc.exe /command:repostatus /pathfile:"<path-to-file-with-list-of-items-to-lookup-from>" (see detailed documentation on the command line: https://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-automation.html), or use some 3dparty applications/utilities/scripts to wrap the call.

I has been wrote my own set of scripts for Windows to automate the call from the Total Commander: https://sf.net/p/contools/contools/HEAD/tree/trunk/Scripts/Tools/ToolAdaptors/totalcmd/README_EN.txt (search for TortoiseSVN)

- Opens TortoiseSVN status dialog for a set of WC directories (always opens to show unversioned changes).

Command:   call_nowindow.vbs
Arguments: tortoisesvn\TortoiseProcByNestedWC.bat /command:repostatus "%P" %S

- Opens TortoiseSVN commit dialogs for a set of WC directories (opens only if has not empty versioned changes).

Command:   call_nowindow.vbs
Arguments: tortoisesvn\TortoiseProcByNestedWC.bat /command:commit "%P" %S

See the README_EN.txt for the latest details (you have to execute the configure.bat before the usage and copy rest of scripts on yourself like call_nowindow.vbs).




回答11:


Using Powershell you can do this:

# Checks for updates and changes in working copy.
# Regex: Excludes unmodified (first 7 columns blank). To exclude more add criteria to negative look ahead.
# -u: svn gets updates
$regex = '^(?!\s{7}).{7}\s+(.+)';
svn status -u | %{ if($_ -match $regex){ $_ } };

This will include property changes. These show in column 2. It will also catch other differences in files that show in columns 3-7.

Sources:

  • svn status: http://svnbook.red-bean.com/en/1.8/svn.ref.svn.c.status.html

  • Regex to match results of svn status: Using powershell and svn to delete unversioned files




回答12:


Right click folder -> Click Tortoise SVN -> Check for modification



来源:https://stackoverflow.com/questions/1168464/svn-list-of-files-that-are-modified-in-local-copy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!