diff src/org/tmatesoft/hg/internal/DirstateBuilder.java @ 705:b4242b7e7dfe

Merge command: implement conflict resolution alternatives
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 15 Aug 2013 18:43:50 +0200
parents 6526d8adbc0f
children 42b88709e41d
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DirstateBuilder.java	Wed Aug 14 20:07:26 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/DirstateBuilder.java	Thu Aug 15 18:43:50 2013 +0200
@@ -92,6 +92,22 @@
 		removed.put(fname, n);
 	}
 	
+	public void recordMerged(Path fname, int fmode, int mtime, int bytesWritten) {
+		forget(fname);
+		merged.put(fname, new HgDirstate.Record(fmode, bytesWritten,mtime, fname, null));
+	}
+	
+	/**
+	 * From DirState wiki:
+	 * <p>"size is ... when the dirstate is in a merge state: -2 will *always* return dirty, it is used to mark a file that was cleanly picked from p2"
+	 * and  
+	 * <p>"Additional meta status...'np2': merged from other parent (status == 'n', size == -2)"
+	 */
+	public void recordMergedFromP2(Path fname) {
+		forget(fname);
+		normal.put(fname, new HgDirstate.Record(0, -2, -1, fname, null));
+	}
+	
 	private HgDirstate.Record forget(Path fname) {
 		HgDirstate.Record r;
 		if ((r = normal.remove(fname)) != null) {