Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/CommitFacility.java @ 621:99ad1e3a4e4d
RevlogStream: be aware of existence (not HgDataFile), facilitate use of an added HgDataFile over a commit; Rollback: be more sensitive about file changes (file size is not enough: write/rollback leaves it intact); tests
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sat, 18 May 2013 22:23:57 +0200 |
parents | 868b2ffdcd5c |
children | 4e6179bde4fc |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/CommitFacility.java Sat May 18 21:55:31 2013 +0200 +++ b/src/org/tmatesoft/hg/internal/CommitFacility.java Sat May 18 22:23:57 2013 +0200 @@ -146,15 +146,9 @@ // NEW FILE fp = new Pair<Integer, Integer>(NO_REVISION, NO_REVISION); } - RevlogStream contentStream; - if (df.exists()) { - contentStream = repo.getImplAccess().getStream(df); - } else { - contentStream = repo.createStoreFile(df.getPath()); + RevlogStream contentStream = repo.getImplAccess().getStream(df); + if (!df.exists()) { newlyAddedFiles.put(df.getPath(), contentStream); - // FIXME df doesn't get df.content updated, and clients - // that would attempt to access newly added file after commit would fail - // (despite the fact the file is in there) } RevlogStreamWriter fileWriter = new RevlogStreamWriter(repo, contentStream, transaction); Nodeid fileRev = fileWriter.addRevision(bds, clogRevisionIndex, fp.first(), fp.second());