diff src/org/tmatesoft/hg/internal/DirstateBuilder.java @ 707:42b88709e41d

Merge: support 'unresolved' resolution with MergeStateBuilder
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 16 Aug 2013 19:22:59 +0200
parents b4242b7e7dfe
children
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DirstateBuilder.java	Fri Aug 16 14:54:09 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/DirstateBuilder.java	Fri Aug 16 19:22:59 2013 +0200
@@ -108,6 +108,22 @@
 		normal.put(fname, new HgDirstate.Record(0, -2, -1, fname, null));
 	}
 	
+	/**
+	 * Mark file from this dirstate as merged, using all the information 
+	 */
+	public void recordMergedExisting(Path fname, Path knownInDirstate) {
+		HgDirstate.Record r = forget(knownInDirstate);
+		HgDirstate.Record n;
+		if (r == null) {
+			assert false;
+			n = new HgDirstate.Record(0, -1, -1, fname, null);
+		} else {
+			n = new HgDirstate.Record(r.mode(), r.size(), r.modificationTime(), fname, r.copySource());
+		}
+		merged.put(fname, n);
+	}
+
+	
 	private HgDirstate.Record forget(Path fname) {
 		HgDirstate.Record r;
 		if ((r = normal.remove(fname)) != null) {