1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Subversion のリビジョンの日時指定を勘違いしていた

Posted at

備忘録。

目的はリポジトリ内のパスに対して、指定日時の直前のリビジョンを取得すること。
そのためにリポジトリ内のパスに対して svn log でリビジョンに日時を指定すると、「そのパス」の指定日時の直前のリビジョンのログを返すと思っていた。
実際にはそうではなくて「そのリポジトリ」の指定日時の直前のリビジョンのログを返そうとする感じ。

Subversion のログを例に示しておく。
Subversion のソースコードは http://svn.apache.org/repos/asf リポジトリの subversion パスで管理されている。下記参照。

~$ svn info http://svn.apache.org/repos/asf/subversion
パス: subversion
URL: http://svn.apache.org/repos/asf/subversion
リポジトリのルート: http://svn.apache.org/repos/asf
... 省略 ...

リポジトリルートに対して svn log で 2015-12-24 を指定するとリビジョン 1721549 が得られる。下記参照。

~$ svn log -q -r '{2015-12-24}' http://svn.apache.org/repos/asf
------------------------------------------------------------------------
r1721549 | anshum | 2015-12-23 23:59:12 +0900 (水, 23 12月 2015)
------------------------------------------------------------------------

しかし subversion パスに対して実施すると出力されない。下記参照。

~$ svn log -q -r '{2015-12-24}' http://svn.apache.org/repos/asf/subversion
------------------------------------------------------------------------

リビジョン 1721549 は lucene パス内のもの。下記参照。

~$ svn log -q -r '{2015-12-24}' http://svn.apache.org/repos/asf/lucene
------------------------------------------------------------------------
r1721549 | anshum | 2015-12-23 23:59:12 +0900 (水, 23 12月 2015)
------------------------------------------------------------------------

2015-12-24 の直前のリビジョンは 1721549 で、subversion パス内のものではないので出力されなかったと理解。

調べた結果、リビジョンの範囲指定と --limit (-l) オプションを使えば目的は達成できた。下記参照。

$ svn log -q -l 1 -r '{2015-12-24}':1 http://svn.apache.org/repos/asf/subversion
------------------------------------------------------------------------
r1721538 | julianfoad | 2015-12-23 21:53:40 +0900 (水, 23 12月 2015)
------------------------------------------------------------------------
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?