Subversionでログを変更するとき

一旦、チェックインした後にログのメッセージを変更したいときがある。TortoiseSVNで「Show Log」を選択し、変更したいログを選んで「Edit Log Message」を選択すれば変更できる。

はずなのだが。。。

Subversionをインストールしたそのままだとエラーが出てしまって変更できない。

DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent
At least one property change failed; repository is unchanged
Error setting property 'log':
Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook

これは一旦、チェックインしたものを簡単には変更できないようにするための措置。サーバーによってはどんな記録でも変更不可にしてAudit Trail機能のように使いたい場合もあるだろう。

自分で使う分には何を変更したって構わない。そこで変更を許可するためには次のファイルを編集する。

C:\Repositories\<プロジェクト名>\hooks\pre-revprop-change.tmpl

VisualSVNをインストールしたままだとSubversionのデフォルトの内容になっている。このファイル名を\pre-revprop-changeに変更し、中身を以下のようにする。

Exit 0

これでログのメッセージを変更できるようになる。このままだとどんな内容でも変更できてしまうので、メッセージの変更だけを許可したい場合、もうちょっと複雑なバッチファイルにする必要があるよう。

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

そこまで面倒なことはしたくないので、僕はその都度、ファイル名のtmplをbatにすることにする(うっかり間違って変更しないようにするため)。

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <code> <cite> <ul> <ol> <li> <dl> <dt> <dd> <p>
  • Lines and paragraphs break automatically.
  • Link to Amazon products with: [amazon product_id inline|full|thumbnail]. Example: [amazon 1590597559 thumbnail]
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.