Mercurial > hg4j
diff 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 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DirstateBuilder.java Wed Apr 17 16:06:10 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/DirstateBuilder.java Fri Apr 19 20:30:34 2013 +0200 @@ -62,17 +62,7 @@ parent2 = p2 == null ? Nodeid.NULL : p2; } - public void recordNormal(Path fname, Flags flags, int bytesWritten) { - // Mercurial seems to write "n 0 -1 unset fname" on `hg --clean co -rev <earlier rev>` - // and the reason for 'force lookup' I suspect is a slight chance of simultaneous modification - // of the file by user that doesn't alter its size the very second dirstate is being written - // (or the file is being updated and the update brought in changes that didn't alter the file size - - // with size and timestamp set, later `hg status` won't notice these changes) - - // However, as long as we use this class to write clean copies of the files, we can put all the fields - // right away. - int fmode = flags == Flags.RegularFile ? 0666 : 0777; // FIXME actual unix flags - int mtime = (int) (System.currentTimeMillis() / 1000); + public void recordNormal(Path fname, int fmode, int mtime, int bytesWritten) { forget(fname); normal.put(fname, new HgDirstate.Record(fmode, bytesWritten, mtime, fname, null)); }