comparison src/org/tmatesoft/hg/internal/CommitFacility.java @ 667:fba85bc1dfb8

Refactoring: move all encoding/decoding operations into single place, EncodingHelper
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 11 Jul 2013 17:54:08 +0200
parents ae2d439fbed3
children b4242b7e7dfe
comparison
equal deleted inserted replaced
666:27a3ddedd6cc 667:fba85bc1dfb8
162 // registerNew shall go after fileWriter.addRevision as it needs to know if data is inlined or not 162 // registerNew shall go after fileWriter.addRevision as it needs to know if data is inlined or not
163 fncache.registerNew(df.getPath(), contentStream); 163 fncache.registerNew(df.getPath(), contentStream);
164 } 164 }
165 } 165 }
166 // 166 //
167 final EncodingHelper encHelper = repo.buildFileNameEncodingHelper();
168 //
167 // Manifest 169 // Manifest
168 final ManifestEntryBuilder manifestBuilder = new ManifestEntryBuilder(repo.buildFileNameEncodingHelper()); 170 final ManifestEntryBuilder manifestBuilder = new ManifestEntryBuilder(encHelper);
169 for (Map.Entry<Path, Nodeid> me : newManifestRevision.entrySet()) { 171 for (Map.Entry<Path, Nodeid> me : newManifestRevision.entrySet()) {
170 manifestBuilder.add(me.getKey().toString(), me.getValue()); 172 manifestBuilder.add(me.getKey().toString(), me.getValue());
171 } 173 }
172 RevlogStreamWriter manifestWriter = new RevlogStreamWriter(repo, repo.getImplAccess().getManifestStream(), transaction); 174 RevlogStreamWriter manifestWriter = new RevlogStreamWriter(repo, repo.getImplAccess().getManifestStream(), transaction);
173 Nodeid manifestRev = manifestWriter.addRevision(manifestBuilder, clogRevisionIndex, manifestParents.first(), manifestParents.second()).second(); 175 Nodeid manifestRev = manifestWriter.addRevision(manifestBuilder, clogRevisionIndex, manifestParents.first(), manifestParents.second()).second();
174 // 176 //
175 // Changelog 177 // Changelog
176 final ChangelogEntryBuilder changelogBuilder = new ChangelogEntryBuilder(); 178 final ChangelogEntryBuilder changelogBuilder = new ChangelogEntryBuilder(encHelper);
177 changelogBuilder.setModified(files.keySet()); 179 changelogBuilder.setModified(files.keySet());
178 changelogBuilder.branch(branch == null ? DEFAULT_BRANCH_NAME : branch); 180 changelogBuilder.branch(branch == null ? DEFAULT_BRANCH_NAME : branch);
179 changelogBuilder.user(String.valueOf(user)); 181 changelogBuilder.user(String.valueOf(user));
180 changelogBuilder.manifest(manifestRev).comment(message); 182 changelogBuilder.manifest(manifestRev).comment(message);
181 RevlogStreamWriter changelogWriter = new RevlogStreamWriter(repo, repo.getImplAccess().getChangelogStream(), transaction); 183 RevlogStreamWriter changelogWriter = new RevlogStreamWriter(repo, repo.getImplAccess().getChangelogStream(), transaction);