Mercurial > jhg
comparison src/org/tmatesoft/hg/internal/DirstateBuilder.java @ 580:bd5926e24aa3
Respect unix flags for checkout/revert
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 19 Apr 2013 20:30:34 +0200 |
parents | 95bdcf75e71e |
children | 65c01508f002 |
comparison
equal
deleted
inserted
replaced
579:36e36b926747 | 580:bd5926e24aa3 |
---|---|
60 public void parents(Nodeid p1, Nodeid p2) { | 60 public void parents(Nodeid p1, Nodeid p2) { |
61 parent1 = p1 == null ? Nodeid.NULL : p1; | 61 parent1 = p1 == null ? Nodeid.NULL : p1; |
62 parent2 = p2 == null ? Nodeid.NULL : p2; | 62 parent2 = p2 == null ? Nodeid.NULL : p2; |
63 } | 63 } |
64 | 64 |
65 public void recordNormal(Path fname, Flags flags, int bytesWritten) { | 65 public void recordNormal(Path fname, int fmode, int mtime, int bytesWritten) { |
66 // Mercurial seems to write "n 0 -1 unset fname" on `hg --clean co -rev <earlier rev>` | |
67 // and the reason for 'force lookup' I suspect is a slight chance of simultaneous modification | |
68 // of the file by user that doesn't alter its size the very second dirstate is being written | |
69 // (or the file is being updated and the update brought in changes that didn't alter the file size - | |
70 // with size and timestamp set, later `hg status` won't notice these changes) | |
71 | |
72 // However, as long as we use this class to write clean copies of the files, we can put all the fields | |
73 // right away. | |
74 int fmode = flags == Flags.RegularFile ? 0666 : 0777; // FIXME actual unix flags | |
75 int mtime = (int) (System.currentTimeMillis() / 1000); | |
76 forget(fname); | 66 forget(fname); |
77 normal.put(fname, new HgDirstate.Record(fmode, bytesWritten, mtime, fname, null)); | 67 normal.put(fname, new HgDirstate.Record(fmode, bytesWritten, mtime, fname, null)); |
78 } | 68 } |
79 | 69 |
80 public void recordUncertain(Path fname) { | 70 public void recordUncertain(Path fname) { |