comparison src/org/tmatesoft/hg/repo/Revlog.java @ 191:b777502a06f5

Do not assume second parent can be set only when first one is set, again
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 14 Apr 2011 19:53:31 +0200
parents 9807bf8f3a9c
children e5407b5a586a
comparison
equal deleted inserted replaced
190:9b99d27aeddc 191:b777502a06f5
271 public boolean appendParentsOf(Nodeid nid, Collection<Nodeid> c) { 271 public boolean appendParentsOf(Nodeid nid, Collection<Nodeid> c) {
272 Nodeid p1 = firstParent(nid); 272 Nodeid p1 = firstParent(nid);
273 boolean modified = false; 273 boolean modified = false;
274 if (p1 != null) { 274 if (p1 != null) {
275 modified = c.add(p1); 275 modified = c.add(p1);
276 Nodeid p2 = secondParent(nid); 276 }
277 if (p2 != null) { 277 Nodeid p2 = secondParent(nid);
278 modified = c.add(p2) || modified; 278 if (p2 != null) {
279 } 279 modified = c.add(p2) || modified;
280 } 280 }
281 return modified; 281 return modified;
282 } 282 }
283 283
284 // XXX alternative (and perhaps more reliable) approach would be to make a copy of allNodes and remove 284 // XXX alternative (and perhaps more reliable) approach would be to make a copy of allNodes and remove