4

私は Mercurial を使用していますが、奇妙な問題があります。私には非常に大きな歴史があり、Mercurial のローカル リビジョンは現在 5 文字です。Mercurial では、「hg up」を実行して、ローカル リビジョンまたはハッシュ チェンジセットのどちらかを選択できます (相互の選択に使用するポリシーがわかりません)。私の場合、ローカル リビジョンは の最初の 5 文字と一致します。別のハッシュ変更セット。例えば:

ローカル リビジョンに更新したい: 80145 実行した場合:

「hg アップ 80145」

Mercurial は必要なリビジョンに更新されません。ハッシュの変更セットが次のとおりであるため、古いものに更新されます。

801454d1cd5e

それで、更新したいリビジョンのタイプを指定する方法があるかどうか誰か知っていますか? ローカル リビジョンまたはハッシュ変更セット。

皆さんありがとう!

====

問題が解決しました。いくつかの調査の後、Mercurial はローカル リビジョンが存在する場合は常に更新し、存在しない場合はハッシュ変更セットに更新することに気付きました。私の場合、ローカルリビジョンが存在しなかったため、ハッシュチェンジセットに更新されていました

4

1 に答える 1

2

独自の回答を見つけたようです (コメントの代わりに回答として入力してから選択する必要があります。これは許可されているだけでなく、ここでは推奨されています)。参考までに、その情報が存在する場所を次に示します。

$ hg help revisions
Specifying Single Revisions

Mercurial supports several ways to specify individual revisions.

A plain integer is treated as a revision number. Negative integers are
treated as sequential offsets from the tip, with -1 denoting the tip, -2
denoting the revision prior to the tip, and so forth.

A 40-digit hexadecimal string is treated as a unique revision identifier.

A hexadecimal string less than 40 characters long is treated as a unique
revision identifier and is referred to as a short-form identifier. A
short-form identifier is only valid if it is the prefix of exactly one
full-length identifier.

Any other string is treated as a bookmark, tag, or branch name. A bookmark
is a movable pointer to a revision. A tag is a permanent name associated
with a revision. A branch name denotes the tipmost revision of that
branch. Bookmark, tag, and branch names must not contain the ":"
character.

The reserved name "tip" always identifies the most recent revision.

The reserved name "null" indicates the null revision. This is the revision
of an empty repository, and the parent of revision 0.

The reserved name "." indicates the working directory parent. If no
working directory is checked out, it is equivalent to null. If an
uncommitted merge is in progress, "." is the revision of the first parent.

したがって、最初の解釈はリビジョン番号としてのものであり、それが何にも一致しなかった場合、リビジョン ID のプレフィックスとして試行されました。理論的には、1変更セットがリビジョンのみ0で、そのハッシュが1.

于 2012-09-17T02:41:26.243 に答える