特定のファイル内の一連の行の履歴を参照するのに役立つ拡張機能またはツールが必要です。現在 [start, end] 行にある特定の関数の履歴を見たいとします。hg annotate で始められます:
AAA 772 06-Aug-02: void Graphics2DDXF::lineTo(double x, // the x coordinate
AAA 772 06-Aug-02: double y // the y cooordinate
AAA 772 06-Aug-02: )
AAA 772 06-Aug-02: {
BBB 2034 30-Aug-04: LOG;
BBB 6989 05-Dec-11:
BBB 4638 31-Oct-07: transform_->transform(&x,&y);
AAA 772 06-Aug-02:
BBB 7011 06-Jan-12: AGcRoot<Line> line = gcnew Line;
BBB 6989 05-Dec-11:
BBB 6989 05-Dec-11: Point3d startPoint(lastPenLocation_->x(), lastPenLocation_->y(), 0.0);
BBB 6989 05-Dec-11: Point3d endPoint(x, y, 0.0);
BBB 6989 05-Dec-11: line->StartPoint = startPoint;
BBB 6989 05-Dec-11: line->EndPoint = endPoint;
BBB 6989 05-Dec-11:
BBB 4638 31-Oct-07: lastPenLocation_ = APoint2D::New(x,y,AToleranceID::None);
BBB 7011 06-Jan-12:
BBB 7011 06-Jan-12: setAndAddEntity(line);
AAA 772 06-Aug-02: }
このメソッドへの最後の変更はチェンジセット 7011 でした。'hg diff -c7011' で調べることができます。
難しいのはその前に起こったことです。7011-1 の注釈出力から始めます。
% hg annotate -r7010 file.cpp
...
AAA 772 06-Aug-02: void Graphics2DDXF::lineTo(double x, // the x coordinate
AAA 772 06-Aug-02: double y // the y cooordinate
AAA 772 06-Aug-02: )
AAA 772 06-Aug-02: {
BBB 2034 30-Aug-04: LOG;
BBB 6989 05-Dec-11:
BBB 4638 31-Oct-07: transform_->transform(&x,&y);
AAA 772 06-Aug-02:
BBB 6989 05-Dec-11: Line^ line = gcnew Line;
AAA 772 06-Aug-02: addEntityToModelSpace(line);
AAA 772 06-Aug-02:
AAA 772 06-Aug-02: ensureLayerAvailable();
BBB 6989 05-Dec-11: line->LayerId = s_currentLayerObjectId;
BBB 6989 05-Dec-11:
BBB 6989 05-Dec-11: Point3d startPoint(lastPenLocation_->x(), lastPenLocation_->y(), 0.0);
BBB 6989 05-Dec-11: Point3d endPoint(x, y, 0.0);
BBB 6989 05-Dec-11: line->StartPoint = startPoint;
BBB 6989 05-Dec-11: line->EndPoint = endPoint;
BBB 6989 05-Dec-11:
BBB 6989 05-Dec-11: line->LinetypeId = currentLinetypeId();
BBB 6989 05-Dec-11: line->ColorIndex = dwgColor(getColor());
BBB 4638 31-Oct-07: lastPenLocation_ = APoint2D::New(x,y,AToleranceID::None);
AAA 772 06-Aug-02: }
これで、この範囲の行に影響を与えた以前の変更セットが 6989 であったことがわかります。
これを行う視覚的なツールがあれば素晴らしいのですが、変更セットのシーケンス (7011、6989 など) を提供するだけのものがあれば幸いです。
行番号範囲の注釈出力をフィルタリングして、変更セットの最大数を見つけることは難しくありません。難しいのは、追加および削除された行を考慮して行の範囲を調整することです。特に、変更が行の範囲の最小または最大に及んでいると「diff」が主張する場合はそうです。少なくとも CVS diff の出力では難しかったので、hg diff の出力では試していません。
私が夢見ているツール/拡張機能が存在しない場合、少なくとも変更された行番号を計算するためのツールはありますか?
ありがとう、