comparison 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
comparison
equal deleted inserted replaced
704:7743a9c10bfa 705:b4242b7e7dfe
88 n = new HgDirstate.Record(0, -1, -1, fname, null); 88 n = new HgDirstate.Record(0, -1, -1, fname, null);
89 } else { 89 } else {
90 n = new HgDirstate.Record(r.mode(), r.size(), r.modificationTime(), fname, r.copySource()); 90 n = new HgDirstate.Record(r.mode(), r.size(), r.modificationTime(), fname, r.copySource());
91 } 91 }
92 removed.put(fname, n); 92 removed.put(fname, n);
93 }
94
95 public void recordMerged(Path fname, int fmode, int mtime, int bytesWritten) {
96 forget(fname);
97 merged.put(fname, new HgDirstate.Record(fmode, bytesWritten,mtime, fname, null));
98 }
99
100 /**
101 * From DirState wiki:
102 * <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"
103 * and
104 * <p>"Additional meta status...'np2': merged from other parent (status == 'n', size == -2)"
105 */
106 public void recordMergedFromP2(Path fname) {
107 forget(fname);
108 normal.put(fname, new HgDirstate.Record(0, -2, -1, fname, null));
93 } 109 }
94 110
95 private HgDirstate.Record forget(Path fname) { 111 private HgDirstate.Record forget(Path fname) {
96 HgDirstate.Record r; 112 HgDirstate.Record r;
97 if ((r = normal.remove(fname)) != null) { 113 if ((r = normal.remove(fname)) != null) {