comparison src/org/tmatesoft/hg/repo/HgBundle.java @ 526:2f9ed6bcefa2

Initial support for Revert command with accompanying minor refactoring
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 15 Jan 2013 17:07:19 +0100
parents a41d955dc360
children 688c1ab113bb
comparison
equal deleted inserted replaced
525:0be5be8d57e9 526:2f9ed6bcefa2
28 import org.tmatesoft.hg.internal.DataAccess; 28 import org.tmatesoft.hg.internal.DataAccess;
29 import org.tmatesoft.hg.internal.DataAccessProvider; 29 import org.tmatesoft.hg.internal.DataAccessProvider;
30 import org.tmatesoft.hg.internal.DigestHelper; 30 import org.tmatesoft.hg.internal.DigestHelper;
31 import org.tmatesoft.hg.internal.Experimental; 31 import org.tmatesoft.hg.internal.Experimental;
32 import org.tmatesoft.hg.internal.InflaterDataAccess; 32 import org.tmatesoft.hg.internal.InflaterDataAccess;
33 import org.tmatesoft.hg.internal.Internals;
33 import org.tmatesoft.hg.internal.Lifecycle; 34 import org.tmatesoft.hg.internal.Lifecycle;
34 import org.tmatesoft.hg.internal.Patch; 35 import org.tmatesoft.hg.internal.Patch;
35 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; 36 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset;
36 import org.tmatesoft.hg.util.Adaptable; 37 import org.tmatesoft.hg.util.Adaptable;
37 import org.tmatesoft.hg.util.CancelledException; 38 import org.tmatesoft.hg.util.CancelledException;
66 if (signature[0] == 'H' && signature[1] == 'G' && signature[2] == '1' && signature[3] == '0') { 67 if (signature[0] == 'H' && signature[1] == 'G' && signature[2] == '1' && signature[3] == '0') {
67 if (signature[4] == 'G' && signature[5] == 'Z') { 68 if (signature[4] == 'G' && signature[5] == 'Z') {
68 return new InflaterDataAccess(da, 6, da.length() - 6); 69 return new InflaterDataAccess(da, 6, da.length() - 6);
69 } 70 }
70 if (signature[4] == 'B' && signature[5] == 'Z') { 71 if (signature[4] == 'B' && signature[5] == 'Z') {
71 throw HgRepository.notImplemented(); 72 throw Internals.notImplemented();
72 } 73 }
73 if (signature[4] != 'U' || signature[5] != 'N') { 74 if (signature[4] != 'U' || signature[5] != 'N') {
74 throw new HgInvalidStateException(String.format("Bad bundle signature: %s", String.valueOf(signature))); 75 throw new HgInvalidStateException(String.format("Bad bundle signature: %s", String.valueOf(signature)));
75 } 76 }
76 // "...UN", fall-through 77 // "...UN", fall-through