diff src/org/tmatesoft/hg/repo/HgBundle.java @ 170:71ddbf8603e8

Initial clone: populate given directory from a bundle. Everything but remote server access is there, albeit prototype code style
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 23 Mar 2011 20:46:00 +0100
parents 8c8e3f372fa1
children f26ffe04ced0
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgBundle.java	Wed Mar 23 14:13:11 2011 +0100
+++ b/src/org/tmatesoft/hg/repo/HgBundle.java	Wed Mar 23 20:46:00 2011 +0100
@@ -148,6 +148,7 @@
 					}
 					RawChangeset cs = RawChangeset.parse(csetDataAccess);
 					System.out.println(cs.toString());
+					prevRevContent.done();
 					prevRevContent = csetDataAccess.reset();
 				} catch (CancelledException ex) {
 					return false;
@@ -190,8 +191,8 @@
 		void fileEnd(String name);
 
 		/**
-		 * @param element
-		 *            data element, instance might be reused
+		 * XXX desperately need exceptions here
+		 * @param element data element, instance might be reused, don't keep a reference to it or its raw data
 		 * @return <code>true</code> to continue
 		 */
 		boolean element(GroupElement element);
@@ -349,6 +350,9 @@
 			// regardless whether that slice has read it or not.
 			GroupElement ge = new GroupElement(nb, slice);
 			good2go = inspector.element(ge);
+			slice.done(); // BADA doesn't implement done(), but it could (e.g. free array) 
+			/// and we'd better tell it we are not going to use it any more. However, it's important to ensure Inspector
+			// implementations out there do not retain GroupElement.rawData()
 			len = da.isEmpty() ? 0 : da.readInt();
 		}
 		// need to skip up to group end if inspector told he don't want to continue with the group,