~piastucki/bzr-eclipse/pre-1.3.1-release-cleanup

« back to all changes in this revision

Viewing changes to org.vcs.bazaar.eclipse.core/src/org/vcs/bazaar/eclipse/BzrWorkspaceRoot.java

  • Committer: Piotr Piastucki
  • Date: 2013-09-18 09:52:43 UTC
  • Revision ID: piotr_piastucki-20130918095243-oh126jsk7eqefz2s
Fix handling of resources inside closed projects

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
         * @return IBzrLocalFile
89
89
         */
90
90
        public static IBzrLocalFile getBzrFileFor(IResource resource) {
91
 
                BzrWorkspaceRoot wkroot = getBzrWorkspaceRootFor(resource.getProject());
92
 
                if(wkroot == null)
93
 
                        return null;
94
 
                IBzrBranch branch = wkroot.getBranch();
 
91
                IBzrBranch branch = BranchFactory.findOrCreateFor(resource.getProject());
95
92
                return new BzrLocalFile(resource, branch);
96
93
        }
97
94
 
101
98
         * @return IBzrLocalFolder
102
99
         */
103
100
        public static IBzrLocalFolder getBzrFolderFor(IContainer resource) {
104
 
                BzrWorkspaceRoot wkroot = getBzrWorkspaceRootFor(resource.getProject());
105
 
                if(wkroot == null)
106
 
                        return null;
107
 
                IBzrBranch branch = wkroot.getBranch();
 
101
                IBzrBranch branch = BranchFactory.findOrCreateFor(resource.getProject());
108
102
                return new BzrLocalFolder(resource, branch);
109
103
        }
110
104