You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Andrey <an...@inbox.ru> on 2017/05/17 17:50:55 UTC

"svn status" does not show unversioned items been deleted but not committed

As a result, for example, you can not say by "svn status" command which  
file you forgot to add.

Reproduction batch script for windows:
```
@echo off

set REPODIR=test_repo
set "REPOROOT=%~dp0%REPODIR%"
set "REPOURL=file:///%REPOROOT:\=/%"
set WCROOT=%REPODIR%_root

if exist "%REPOROOT%\" rmdir /S /Q "%REPOROOT%"
if exist "%WCROOT%\" rmdir /S /Q "%WCROOT%"

mkdir "%REPOROOT%"
svnadmin create "%REPOROOT%"
mkdir "%WCROOT%"

svn co "%REPOURL%" "%WCROOT%"

rem creating simple file
type nul > "%WCROOT%/file1.txt"
svn add "%WCROOT%/file1.txt"
svn ci "%WCROOT%" -m "rev1"

rem update to the head
svn up "%WCROOT%"

rem add new file to the directory but do not add it to the version control
type nul > "%WCROOT%/file2.txt"

rem test status
echo --- svn status 1 ---
svn status "%WCROOT%"
echo ---

rem rename file
svn mv "%WCROOT%/file1.txt" "%WCROOT%/file_bubbles.txt" || goto :EOF

rem add a new file instead
type nul > "%WCROOT%/file1.txt"

rem test status again
echo --- svn status 2 ---
svn status "%WCROOT%"
echo ---

rem after this point the status output missed file1.txt file as  
unversioned file in the listing
```

The script output:
```
Checked out revision 0.
A         test_repo_root\file1.txt
Adding         test_repo_root\file1.txt
Transmitting file data .done
Committing transaction...
Committed revision 1.
Updating 'test_repo_root':
At revision 1.
--- svn status 1 ---
?       test_repo_root\file2.txt
---
A         test_repo_root\file_bubbles.txt
D         test_repo_root\file1.txt
--- svn status 2 ---
D       test_repo_root\file1.txt
         > moved to test_repo_root\file_bubbles.txt
?       test_repo_root\file2.txt
A  +    test_repo_root\file_bubbles.txt
         > moved from test_repo_root\file1.txt
---
```

As you see the file1.txt is missed in second status output as unversioned  
and so can be missed from add before a commit.

-- 
Написано с помощью почтового клиента Opera: http://www.opera.com/mail/

Re: "svn status" does not show unversioned items been deleted but not committed

Posted by Branko Čibej <br...@apache.org>.
On 17.05.2017 19:50, Andrey wrote:
> As a result, for example, you can not say by "svn status" command
> which file you forgot to add.
>
> Reproduction batch script for windows:
> ```
> @echo off
>
> set REPODIR=test_repo
> set "REPOROOT=%~dp0%REPODIR%"
> set "REPOURL=file:///%REPOROOT:\=/%"
> set WCROOT=%REPODIR%_root
>
> if exist "%REPOROOT%\" rmdir /S /Q "%REPOROOT%"
> if exist "%WCROOT%\" rmdir /S /Q "%WCROOT%"
>
> mkdir "%REPOROOT%"
> svnadmin create "%REPOROOT%"
> mkdir "%WCROOT%"
>
> svn co "%REPOURL%" "%WCROOT%"
>
> rem creating simple file
> type nul > "%WCROOT%/file1.txt"
> svn add "%WCROOT%/file1.txt"
> svn ci "%WCROOT%" -m "rev1"
>
> rem update to the head
> svn up "%WCROOT%"
>
> rem add new file to the directory but do not add it to the version
> control
> type nul > "%WCROOT%/file2.txt"
>
> rem test status
> echo --- svn status 1 ---
> svn status "%WCROOT%"
> echo ---
>
> rem rename file
> svn mv "%WCROOT%/file1.txt" "%WCROOT%/file_bubbles.txt" || goto :EOF
>
> rem add a new file instead
> type nul > "%WCROOT%/file1.txt"
>
> rem test status again
> echo --- svn status 2 ---
> svn status "%WCROOT%"
> echo ---
>
> rem after this point the status output missed file1.txt file as
> unversioned file in the listing
> ```
>
> The script output:
> ```
> Checked out revision 0.
> A         test_repo_root\file1.txt
> Adding         test_repo_root\file1.txt
> Transmitting file data .done
> Committing transaction...
> Committed revision 1.
> Updating 'test_repo_root':
> At revision 1.
> --- svn status 1 ---
> ?       test_repo_root\file2.txt
> ---
> A         test_repo_root\file_bubbles.txt
> D         test_repo_root\file1.txt
> --- svn status 2 ---
> D       test_repo_root\file1.txt
>         > moved to test_repo_root\file_bubbles.txt
> ?       test_repo_root\file2.txt
> A  +    test_repo_root\file_bubbles.txt
>         > moved from test_repo_root\file1.txt
> ---
> ```
>
> As you see the file1.txt is missed in second status output as
> unversioned and so can be missed from add before a commit.

It's not unversioned, it's in the "deleted" state. You can't have both,
since you can revert the deletion.

-- Brane