comparison src/org/tmatesoft/hg/core/HgCloneCommand.java @ 274:9fb50c04f03c

Use Nodeid.isNull check instead of NULL.equals
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 25 Aug 2011 03:57:39 +0200
parents 883f1efbcf27
children a415fe296a50
comparison
equal deleted inserted replaced
273:8f872bd7ddd2 274:9fb50c04f03c
230 throw new HgBadStateException(ex); 230 throw new HgBadStateException(ex);
231 } 231 }
232 } 232 }
233 233
234 private int knownRevision(Nodeid p) { 234 private int knownRevision(Nodeid p) {
235 if (NULL.equals(p)) { 235 if (p.isNull()) {
236 return -1; 236 return -1;
237 } else { 237 } else {
238 for (int i = revisionSequence.size() - 1; i >= 0; i--) { 238 for (int i = revisionSequence.size() - 1; i >= 0; i--) {
239 if (revisionSequence.get(i).equals(p)) { 239 if (revisionSequence.get(i).equals(p)) {
240 return i; 240 return i;
248 try { 248 try {
249 assert indexFile != null; 249 assert indexFile != null;
250 boolean writeComplete = false; 250 boolean writeComplete = false;
251 Nodeid p1 = ge.firstParent(); 251 Nodeid p1 = ge.firstParent();
252 Nodeid p2 = ge.secondParent(); 252 Nodeid p2 = ge.secondParent();
253 if (NULL.equals(p1) && NULL.equals(p2) /* or forced flag, does REVIDX_PUNCHED_FLAG indicate that? */) { 253 if (p1.isNull() && p2.isNull() /* or forced flag, does REVIDX_PUNCHED_FLAG indicate that? */) {
254 prevRevContent = new ByteArrayDataAccess(new byte[0]); 254 prevRevContent = new ByteArrayDataAccess(new byte[0]);
255 writeComplete = true; 255 writeComplete = true;
256 } 256 }
257 byte[] content = ge.apply(prevRevContent); 257 byte[] content = ge.apply(prevRevContent);
258 byte[] calculated = dh.sha1(p1, p2, content).asBinary(); 258 byte[] calculated = dh.sha1(p1, p2, content).asBinary();