Mercurial > hg4j
comparison src/org/tmatesoft/hg/repo/HgRepository.java @ 115:c0cc2535462c
Introduced channels to pipeline (and easily filter) data streams
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 03 Feb 2011 23:32:08 +0100 |
parents | 46291ec605a0 |
children | 4a948ec83980 |
comparison
equal
deleted
inserted
replaced
114:46291ec605a0 | 115:c0cc2535462c |
---|---|
137 | 137 |
138 public HgDataFile getFileNode(String path) { | 138 public HgDataFile getFileNode(String path) { |
139 String nPath = normalizePath.rewrite(path); | 139 String nPath = normalizePath.rewrite(path); |
140 String storagePath = dataPathHelper.rewrite(nPath); | 140 String storagePath = dataPathHelper.rewrite(nPath); |
141 RevlogStream content = resolve(Path.create(storagePath)); | 141 RevlogStream content = resolve(Path.create(storagePath)); |
142 return new HgDataFile(this, Path.create(nPath), content); | 142 Path p = Path.create(nPath); |
143 if (content == null) { | |
144 return new HgDataFile(this, p); | |
145 } | |
146 return new HgDataFile(this, p, content); | |
143 } | 147 } |
144 | 148 |
145 public HgDataFile getFileNode(Path path) { | 149 public HgDataFile getFileNode(Path path) { |
146 String storagePath = dataPathHelper.rewrite(path.toString()); | 150 String storagePath = dataPathHelper.rewrite(path.toString()); |
147 RevlogStream content = resolve(Path.create(storagePath)); | 151 RevlogStream content = resolve(Path.create(storagePath)); |
148 // XXX no content when no file? or HgDataFile.exists() to detect that? How about files that were removed in previous releases? | 152 // XXX no content when no file? or HgDataFile.exists() to detect that? |
153 if (content == null) { | |
154 return new HgDataFile(this, path); | |
155 } | |
149 return new HgDataFile(this, path, content); | 156 return new HgDataFile(this, path, content); |
150 } | 157 } |
151 | 158 |
152 public PathRewrite getPathHelper() { // Really need to be public? | 159 public PathRewrite getPathHelper() { // Really need to be public? |
153 return normalizePath; | 160 return normalizePath; |