comparison src/org/tmatesoft/hg/internal/CommitFacility.java @ 619:868b2ffdcd5c

Close FIS, not FileChannel, to clear both references to FileDescriptor right away
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 17 May 2013 22:04:23 +0200
parents 7c0d2ce340b8
children 99ad1e3a4e4d
comparison
equal deleted inserted replaced
618:7c0d2ce340b8 619:868b2ffdcd5c
194 repo.getLog().dump(getClass(), Error, ex, "Failed to write fncache, error ignored"); 194 repo.getLog().dump(getClass(), Error, ex, "Failed to write fncache, error ignored");
195 } 195 }
196 } 196 }
197 String oldBranchValue = DirstateReader.readBranch(repo); 197 String oldBranchValue = DirstateReader.readBranch(repo);
198 String newBranchValue = branch == null ? DEFAULT_BRANCH_NAME : branch; 198 String newBranchValue = branch == null ? DEFAULT_BRANCH_NAME : branch;
199 // TODO undo.dirstate and undo.branch as described in http://mercurial.selenic.com/wiki/FileFormats#undo..2A
200 if (!oldBranchValue.equals(newBranchValue)) { 199 if (!oldBranchValue.equals(newBranchValue)) {
200 // prepare undo.branch as described in http://mercurial.selenic.com/wiki/FileFormats#undo..2A
201 File branchFile = transaction.prepare(repo.getRepositoryFile(Branch), repo.getRepositoryFile(UndoBranch)); 201 File branchFile = transaction.prepare(repo.getRepositoryFile(Branch), repo.getRepositoryFile(UndoBranch));
202 FileOutputStream fos = null; 202 FileOutputStream fos = null;
203 try { 203 try {
204 fos = new FileOutputStream(branchFile); 204 fos = new FileOutputStream(branchFile);
205 fos.write(newBranchValue.getBytes(EncodingHelper.getUTF8())); 205 fos.write(newBranchValue.getBytes(EncodingHelper.getUTF8()));