SVN ' pre-revprop-change kanca ve nasıl oluşturabilirim? | Netgez.com
SORU
13 EKÄ°M 2008, PAZARTESÄ°


SVN ' pre-revprop-change kanca ve nasıl oluşturabilirim?

Depo tarayıcıda günlük yorum düzenlemek istedim ve pre-revprop-change hiçbir kanca depo için var olan bir hata mesajı aldım. Pre-revprop-change kanca ne korkunç bir isim olmasının yanı sıra, nasıl oluştururum?

CEVAP
22 Ocak 2009, PERÅžEMBE


Windows için, burada bir örnek sadece günlük mesaj (diğer özellikler) değişiklik izin veren bir toplu iş dosyası için bir link:

http://ayria.livejournal.com/33438.html

Temel olarak aşağıdaki kodu bir metin dosyasına kopyalayın ve Adı pre-revprop-change.bat ve kaydedin deponuzu \hooks alt.

@ECHO OFF
:: Set all parameters. Even though most are not used, in case you want to add
:: changes that allow, for example, editing of the author or addition of log messages.
set repository=%1
set revision=%2
set userName=%3
set propertyName=%4
set action=%5

:: Only allow the log message to be changed, but not author, etc.
if /I not "%propertyName%" == "svn:log" goto ERROR_PROPNAME

:: Only allow modification of a log message, not addition or deletion.
if /I not "¬tion%" == "M" goto ERROR_ACTION

:: Make sure that the new svn:log message is not empty.
set bIsEmpty=true
for /f "tokens=*" %%g in ('find /V ""') do (
set bIsEmpty=false
)
if "%bIsEmpty%" == "true" goto ERROR_EMPTY

goto :eof

:ERROR_EMPTY
echo Empty svn:log messages are not allowed. >&2
goto ERROR_EXIT

:ERROR_PROPNAME
echo Only changes to svn:log messages are allowed. >&2
goto ERROR_EXIT

:ERROR_ACTION
echo Only modifications to svn:log revision properties are allowed. >&2
goto ERROR_EXIT

:ERROR_EXIT
exit /b 1

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VÄ°DEO

Rastgele Yazarlar

  • Electro Posé

    Electro PosÃ

    21 ÅžUBAT 2013
  • julioissk84life

    julioissk84l

    18 ÅžUBAT 2008
  • XxMinayaxX1

    XxMinayaxX1

    9 Mayıs 2012

Ä°LGÄ°LÄ° SORU / CEVAPLAR