# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. Index: versioncontrol/apichanges.xml --- versioncontrol/apichanges.xml Base (1.3) +++ versioncontrol/apichanges.xml Locally Modified (Based On 1.3) @@ -108,6 +108,19 @@ + Added getFiles() method to VCSContext + + + + + + This new method provides access to all files and folders that the user originally selected in the IDE. Current + getRootFiles() method removes files from the context if their ancestors are already in the context. + + + + + Added beforeEdit method to VCSInterceptor Index: versioncontrol/src/org/netbeans/modules/versioning/spi/VCSContext.java --- versioncontrol/src/org/netbeans/modules/versioning/spi/VCSContext.java Base (1.20) +++ versioncontrol/src/org/netbeans/modules/versioning/spi/VCSContext.java Locally Modified (Based On 1.20) @@ -85,6 +85,7 @@ private final Lookup elements; + private final Set unfilteredRootFiles; private final Set rootFiles; private final Set exclusions; @@ -184,9 +185,28 @@ /** * Retrieves set of files/folders that represent this context. + * This set contains all files the user selected, unfiltered. + * For example, if the user selects two elements: folder /var and file /var/Foo.java then getFiles() + * returns both of them and getRootFiles returns only the folder /var. + * This method is suitable for versioning systems that DO manage folders, such as Clearcase. * * @return Set set of Files this context represents + * @see #getRootFiles() */ + public Set getFiles() { + return unfilteredRootFiles; + } + + /** + * Retrieves set of root files/folders that represent this context. + * This set only contains context roots, not files/folders that are contained within these roots. + * For example, if the user selects two elements: folder /var and file /var/Foo.java then getFiles() + * returns both of them and getRootFiles returns only the folder /var. + * This method is suitable for versioning systems that do not manage folders, such as CVS. + * + * @return Set set of Files this context represents + * @see #getFiles() + */ public Set getRootFiles() { return rootFiles; } @@ -308,6 +328,7 @@ this.elements = nodes != null ? Lookups.fixed(nodes) : Lookups.fixed(new Node[0]); Set tempRootFiles = new HashSet(rootFiles); Set tempExclusions = new HashSet(exclusions); + this.unfilteredRootFiles = Collections.unmodifiableSet(new HashSet(tempRootFiles)); while (normalize(tempRootFiles, tempExclusions)); this.rootFiles = Collections.unmodifiableSet(tempRootFiles); this.exclusions = Collections.unmodifiableSet(tempExclusions);