001package org.vishia.guiBzr;
002
003import java.io.File;
004import java.util.List;
005import java.util.Map;
006import java.util.TreeMap;
007
008/**This class contains all data from the Source-Archive of one component. 
009 * @author Hartmut Schorrig
010 *
011 */
012public class DataCmpn
013{
014  
015  static class Revision{
016    /**The version number String. */
017    String nr;
018    
019    /**The timestamp of the version. */
020    long date;
021  }
022  
023  /**Name of the component. It is the directory name of the directory 
024   * where the archive is contained in. */
025  final String sNameCmpn;
026  
027  /**Directory where the .bzr of the working tree is contained. */
028  final File dirWorkingtree;
029
030  /**Directory where the .bzr of the archive (without working tree) is contained. */
031  final File dirArchive;
032
033  /**Directory where the .bzr of any remote .bzr is contained. */
034  final File dirRemoteArchive;
035
036  /**The version number form the last commit or revert in this sandbox 
037   * and the top version number in the branch. If the branch was updated in another Sandbox,
038   * it may have a higher number. If the sandbox isn't actual, it may be a older number.
039   * <ul>
040   * <li>The sandbox version is stored either in the file _BzrVersion.txt, which is the output
041   * from a invocation "bzr log -l 1" after last commit or revert.
042   * <li>Or the sandbox version is stored in the bzr data file of the project.
043   * </ul>  
044   */
045  final Revision revisionSbox = new Revision(), revisionWorkingTreeTop = new Revision(), revisionArchive = new Revision(), revisionRemoteArchive = new Revision();
046
047  /**Output of bzr status invocation of the working box. */
048  StringBuilder uBzrStatusOutput = new StringBuilder();
049  /**Output of bzr log -l 1 to get the last version number. */
050  StringBuilder uBzrLastVersion = new StringBuilder();
051  /**General error output of all commands. */
052  StringBuilder uBzrError = new StringBuilder();
053  
054  List<DataFile> listModifiedFiles;
055  
056  List<DataFile> listRemovedFiles;
057  
058  List<DataFile> listNewFiles;
059  
060  List<DataFile> listAddFiles;
061  
062  List<DataFile> listRenamedFiles;
063  
064  final Map<String, DataFile> indexFiles = new TreeMap<String, DataFile>();
065  
066  public File getBzrLocationDir(){ return dirWorkingtree; }
067  
068
069  DataCmpn(File dirComponent, File dirArchive, File dirRemoteArchive)
070  {
071    this.dirWorkingtree = dirComponent;
072    this.dirArchive = dirArchive;
073    this.dirRemoteArchive = dirRemoteArchive;
074    this.sNameCmpn = dirComponent.getName();
075      
076  }
077  
078}