3r1co / hg4j

Automatically exported from code.google.com/p/hg4j
GNU General Public License v2.0
0 stars 1 forks source link

Renames/copies other than for the very first revision of a file are not recognized #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With a sequence of renames f1 -> f2 -> f1, f1's history lists rename metadata 
not in the first revision (as HgDataFile#isCopy() assumes):

Index    Link Rev  Parent1  Parent2     nodeid
   0:           0       -1       -1     b80de5...
<NO DATA>
   1:           1        0       -1     1cd3fe...
aaa

   2:           4       -1       -1     f16fe8...
<PATCH>:
0..0, 66:\1
copy: file2
copyrev: f8d6e6...
\1

4..4, 4:bbb

   3:           5        2       -1     d73ea6...
aaa
bbb
ccc

Although the case is quite rare, and hg4j simply reports all file1 changes 
(like `hg log` does, without '--follow'), HgLogCommand with followRenames==true 
outcome is incorrect.

Original issue reported on code.google.com by tikhomir...@gmail.com on 16 Apr 2013 at 6:31

GoogleCodeExporter commented 8 years ago
Fixed in revision 5050ee565bd1
Tests pending

Original comment by tikhomir...@gmail.com on 27 Jul 2013 at 8:07

GoogleCodeExporter commented 8 years ago
Utility class FileRenameHistory to build sequence of name changes and 
corresponding revisions. Rest of the code relies on this class either using 
this history chunks directly (status), or building own abstractions on top of 
it (log/history).

HgChangesetFileSneaker uses similar, although more complicated logic as it 
looks for alternative renames instead of default 'follow first encountered 
rename' strategy.

Tests: TestFileRenameUtils, TestHistory#testFollowMultipleRenames and 
log-renames repository with few sample renames.

Original comment by tikhomir...@gmail.com on 5 Aug 2013 at 2:45