В настоящее время я работаю над проектом Qt c ++, который в основном печатает все сообщения журнала фиксации между двумя конкретными ревизиями репозитория SVN (пользователь вводит репо и ревизии).
Мне нужно получить количество ревизий в URL репо.
Я хочу сделать это в Windows 10, поэтому я думаю, что пакетная команда может быть очень полезна.
Я использую Visual SVN Server и Tornise SVN.
(Моя версия Qt 5.11.1, если это будет необходимо)
У меня есть пакетный скрипт, который печатает все журналы между двумя конкретными ревизиями в файл .txt.
Это так:
@ECHO OFF
REM This Script Takes all the logs between a given repository's 2 specific revision.
REM Below, we store the first parameter which is the URL of the Repository that is wanted.
SET urlOfRepository=%1
REM Below, we store the second parameter which is the first revision that is wanted.
SET firstRevision=%2
REM Below, we store the third parameter which is the second revision that is wanted.
SET secondRevision=%3
REM Below is the command for getting all the log messages between the first and the second revision that is wanted in the wanted repository and printing to a .txt file.
svn log -r %firstRevision%:%secondRevision% --limit %secondRevision% %urlOfRepository% > svnLog.txt
EXIT /B 0
Буду рад, если кто-нибудь сможет мне помочь.
Я могу уточнить вопрос, если это необходимо, поэтому, пожалуйста, не стесняйтесь обращаться ко мне через комментарии.
Заранее спасибо.
Благодаря Kostix ответ:
svn info -r HEAD --show-item revision %URL%
И я написал сценарий, чтобы решить мою проблему. Вот оно:
@ECHO OFF
REM This Script writes the revision count of a specific SVN repository
REM Below, we store the first parameter which is the URL of the Repository that is wanted.
SET urlOfRepository=%1
REM Below, is the command that returns the count of revisions in the specifically given SVN repository and writes to a .txt file
svn info -r HEAD --show-item revision %urlOfRepository% > svnCountOfRepoRevisions.txt
EXIT /B 0