# HG changeset patch # User Artem Tikhomirov # Date 1368906931 -7200 # Node ID 272ecffccc8af78d53d2a05d6f0e0cd3197dd72f # Parent 868b2ffdcd5c0acfa164b333533e0892779709a6 Do not cache branch value of working copy as it's not possible to refresh it after commit now diff -r 868b2ffdcd5c -r 272ecffccc8a src/org/tmatesoft/hg/repo/HgRepository.java --- a/src/org/tmatesoft/hg/repo/HgRepository.java Fri May 17 22:04:23 2013 +0200 +++ b/src/org/tmatesoft/hg/repo/HgRepository.java Sat May 18 21:55:31 2013 +0200 @@ -113,14 +113,6 @@ private final org.tmatesoft.hg.internal.Internals impl; - /* - * TODO [post-1.0] move to a better place, e.g. WorkingCopy container that tracks both dirstate and branches - * (and, perhaps, undo, lastcommit and other similar information), and is change listener so that we don't need to - * worry about this cached value become stale - */ - private String wcBranch; - - HgRepository(String repositoryPath) { workingDir = null; repoLocation = repositoryPath; @@ -274,9 +266,13 @@ * @throws HgInvalidControlFileException if attempt to read branch name failed. */ public String getWorkingCopyBranchName() throws HgInvalidControlFileException { - if (wcBranch == null) { - wcBranch = DirstateReader.readBranch(impl); - } + /* + * TODO [post-1.1] 1) cache value (now if cached, is not updated after commit) + * 2) move to a better place, e.g. WorkingCopy container that tracks both dirstate and branches + * (and, perhaps, undo, lastcommit and other similar information), and is change listener so that we don't need to + * worry about this cached value become stale + */ + String wcBranch = DirstateReader.readBranch(impl); return wcBranch; }