comparison src/org/tmatesoft/hg/repo/HgDataFile.java @ 571:e4ee4bf4c7d0

Let session context control creation of Path instances
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 11 Apr 2013 16:27:06 +0200
parents abfbe81154b5
children 46f29b73e51e
comparison
equal deleted inserted replaced
570:36853bb80a35 571:e4ee4bf4c7d0
399 * @return name of the file origin 399 * @return name of the file origin
400 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em> 400 * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
401 */ 401 */
402 public Path getCopySourceName() throws HgRuntimeException { 402 public Path getCopySourceName() throws HgRuntimeException {
403 if (isCopy()) { 403 if (isCopy()) {
404 return Path.create(metadata.find(0, "copy")); 404 Path.Source ps = getRepo().getSessionContext().getPathFactory();
405 return ps.path(metadata.find(0, "copy"));
405 } 406 }
406 throw new UnsupportedOperationException(); // XXX REVISIT, think over if Exception is good (clients would check isCopy() anyway, perhaps null is sufficient?) 407 throw new UnsupportedOperationException(); // XXX REVISIT, think over if Exception is good (clients would check isCopy() anyway, perhaps null is sufficient?)
407 } 408 }
408 409
409 /** 410 /**