3r1co / hg4j

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

UnsupportedOperationException when patching empty base revision #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There are chances to face repositories where a patch fills empty base revision. 
In fact, use of patch is less effective than just writing complete revision, 
and likely contemporary Mercurial versions won't do that.

python.hg/.hg/store/data/_lib/test/test__index.py.i

0x10001, inline: true
Index  Offset   Packed   Actual   Base Rev   Link Rev  Parent1  Parent2
   0:   0       0        0          0        36882       -1       -1 
<NO DATA>
   1:   0       921      3727       0        37879        0       -1     
<PATCH>:
0..0, 3727
   2:...

Now it fails with UnsupportedOperationException from DataAccess.seek(0). Base 
revision content is basic DataAccess instance, empty (fine), although doesn't 
tolerate even 0 offset reads and seeks patch logic tries to perform.

Original issue reported on code.google.com by tikhomir...@gmail.com on 22 Feb 2012 at 9:35

GoogleCodeExporter commented 8 years ago
Issue 22 comment 3 records almost identical stacktrace and is about an attempt 
to apply empty patch to an empty repository but as it's dedicated to specific 
case (empty repository), this issue tracks slightly different scenario (empty 
base revision)

Original comment by tikhomir...@gmail.com on 22 Feb 2012 at 9:39

GoogleCodeExporter commented 8 years ago
TestStatus#testPatchZeroLengthBaseRevision() and status-5/file2
Branches: default, smartgit3

Original comment by tikhomir...@gmail.com on 23 Feb 2012 at 9:25