private void undo(Cell cell) { if (!CVS.isDELIB(cell.getLibrary())) return; File libraryFile = TextUtils.getFile(cell.getLibrary().getLibFile()); if (libraryFile == null) return; String libfile = libraryFile.getPath(); // get cell directory if not already added before // check cell files File cellFile = new File(libfile, DELIB.getCellFile(cell)); if (undo(cellFile)) { State state = CVSLibrary.getState(cell); if (state == State.ADDED) CVSLibrary.setState(cell, State.UNKNOWN); if (state == State.REMOVED) CVSLibrary.setState(cell, State.NONE); } }
private void generate(StringBuffer buf, Library lib, String useDir) { // see if library file is in CVS File libraryFile = TextUtils.getFile(lib.getLibFile()); if (libraryFile == null) return; String libfile = libraryFile.getPath(); add(buf, libfile, useDir); if (CVS.isDELIB(lib)) { // see if cell directories are in CVS for (Iterator<Cell> it = lib.getCells(); it.hasNext(); ) { generate(buf, it.next(), useDir); } // add header file File headerFile = new File(libfile, DELIB.getHeaderFile()); add(buf, headerFile.getPath(), useDir); } }
private void undo(Library lib) { // see if library file is in CVS File libraryFile = TextUtils.getFile(lib.getLibFile()); if (libraryFile == null) return; String libfile = libraryFile.getPath(); if (!CVS.isDELIB(lib)) { if (undo(new File(libfile))) { State state = CVSLibrary.getState(lib); if (state == State.ADDED) CVSLibrary.setState(lib, State.UNKNOWN); if (state == State.REMOVED) CVSLibrary.setState(lib, State.NONE); } } else { for (Iterator<Cell> it = lib.getCells(); it.hasNext(); ) { undo(it.next()); } // undo header file File headerFile = new File(libfile, DELIB.getHeaderFile()); undo(headerFile); } }
private void generate(StringBuffer buf, Cell cell, String useDir) { if (!CVS.isDELIB(cell.getLibrary())) return; File libraryFile = TextUtils.getFile(cell.getLibrary().getLibFile()); if (libraryFile == null) return; String libfile = libraryFile.getPath(); // get cell directory if not already added before File celldirFile = new File(libfile, DELIB.getCellSubDir(cell.getId())); String celldir = celldirFile.getPath(); if (!addedCellDirs.containsKey(celldir) && !libfile.equals(celldir)) { if (celldirFile.exists()) add(buf, celldir, useDir); addedCellDirs.put(celldir, null); } // check cell files File cellFile = new File(libfile, DELIB.getCellFile(cell)); add(buf, cellFile.getPath(), useDir); // check that header is added or in cvs, or library is going to be added if (add) { File headerFile = new File(libfile, DELIB.getHeaderFile()); if (!libs.contains(cell.getLibrary()) && !CVS.isFileInCVS(headerFile)) { add(buf, headerFile.getPath(), useDir); } } }