git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@982469 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -42,6 +42,10 @@ Changes that could break older environments: | |||||
| of Ant 1.8.1. | of Ant 1.8.1. | ||||
| Bugzilla Report 49373. | Bugzilla Report 49373. | ||||
| * The files and directories used by Git, Mercurial and Bazaar to | |||||
| store their information are now excluded by the defaultexcludes. | |||||
| Bugzilla Report 49624. | |||||
| Fixed bugs: | Fixed bugs: | ||||
| ----------- | ----------- | ||||
| @@ -265,7 +265,7 @@ as an implicit fileset.</p> | |||||
| <h3><a name="defaultexcludes">Default Excludes</a></h3> | <h3><a name="defaultexcludes">Default Excludes</a></h3> | ||||
| <p>There are a set of definitions that are excluded by default from all | <p>There are a set of definitions that are excluded by default from all | ||||
| directory-based tasks. They are:</p> | |||||
| directory-based tasks. As of Ant 1.8.1 they are:</p> | |||||
| <pre> | <pre> | ||||
| **/*~ | **/*~ | ||||
| **/#*# | **/#*# | ||||
| @@ -282,6 +282,23 @@ directory-based tasks. They are:</p> | |||||
| **/.svn/** | **/.svn/** | ||||
| **/.DS_Store | **/.DS_Store | ||||
| </pre> | </pre> | ||||
| <p>Ant 1.8.2 adds the folllowing default excludes:</p> | |||||
| <pre> | |||||
| **/.git | |||||
| **/.git/** | |||||
| **/.gitattributes | |||||
| **/.gitignore | |||||
| **/.gitmodules | |||||
| **/.hg | |||||
| **/.hg/** | |||||
| **/.hgignore | |||||
| **/.hgsub | |||||
| **/.hgsubstate | |||||
| **/.hgtags | |||||
| **/.bzr | |||||
| **/.bzr/** | |||||
| **/.bzrignore | |||||
| </pre> | |||||
| <p>If you do not want these default excludes applied, you may disable | <p>If you do not want these default excludes applied, you may disable | ||||
| them with the <code>defaultexcludes="no"</code> | them with the <code>defaultexcludes="no"</code> | ||||
| attribute.</p> | attribute.</p> | ||||
| @@ -170,6 +170,26 @@ public class DirectoryScanner | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.svn", | SelectorUtils.DEEP_TREE_MATCH + "/.svn", | ||||
| SelectorUtils.DEEP_TREE_MATCH + "/.svn/" + SelectorUtils.DEEP_TREE_MATCH, | SelectorUtils.DEEP_TREE_MATCH + "/.svn/" + SelectorUtils.DEEP_TREE_MATCH, | ||||
| // Git | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.git", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.git/" + SelectorUtils.DEEP_TREE_MATCH, | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.gitattributes", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.gitignore", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.gitmodules", | |||||
| // Mercurial | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.hg", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.hg/" + SelectorUtils.DEEP_TREE_MATCH, | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.hgignore", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.hgsub", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.hgsubstate", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.hgtags", | |||||
| // Bazaar | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.bzr", | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.bzr/" + SelectorUtils.DEEP_TREE_MATCH, | |||||
| SelectorUtils.DEEP_TREE_MATCH + "/.bzrignore", | |||||
| // Mac | // Mac | ||||
| SelectorUtils.DEEP_TREE_MATCH + "/.DS_Store" | SelectorUtils.DEEP_TREE_MATCH + "/.DS_Store" | ||||
| }; | }; | ||||
| @@ -53,6 +53,20 @@ public class DefaultExcludesTest extends BuildFileTest { | |||||
| "**/vssver.scc", | "**/vssver.scc", | ||||
| "**/.svn", | "**/.svn", | ||||
| "**/.svn/**", | "**/.svn/**", | ||||
| "**/.git", | |||||
| "**/.git/**", | |||||
| "**/.gitattributes", | |||||
| "**/.gitignore", | |||||
| "**/.gitmodules", | |||||
| "**/.hg", | |||||
| "**/.hg/**", | |||||
| "**/.hgignore", | |||||
| "**/.hgsub", | |||||
| "**/.hgsubstate", | |||||
| "**/.hgtags", | |||||
| "**/.bzr", | |||||
| "**/.bzr/**", | |||||
| "**/.bzrignore", | |||||
| "**/.DS_Store"}; | "**/.DS_Store"}; | ||||
| project.executeTarget("test1"); | project.executeTarget("test1"); | ||||
| assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes()); | assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes()); | ||||
| @@ -74,6 +88,20 @@ public class DefaultExcludesTest extends BuildFileTest { | |||||
| "**/vssver.scc", | "**/vssver.scc", | ||||
| "**/.svn", | "**/.svn", | ||||
| "**/.svn/**", | "**/.svn/**", | ||||
| "**/.git", | |||||
| "**/.git/**", | |||||
| "**/.gitattributes", | |||||
| "**/.gitignore", | |||||
| "**/.gitmodules", | |||||
| "**/.hg", | |||||
| "**/.hg/**", | |||||
| "**/.hgignore", | |||||
| "**/.hgsub", | |||||
| "**/.hgsubstate", | |||||
| "**/.hgtags", | |||||
| "**/.bzr", | |||||
| "**/.bzr/**", | |||||
| "**/.bzrignore", | |||||
| "**/.DS_Store", | "**/.DS_Store", | ||||
| "foo"}; | "foo"}; | ||||
| project.executeTarget("test2"); | project.executeTarget("test2"); | ||||
| @@ -96,6 +124,20 @@ public class DefaultExcludesTest extends BuildFileTest { | |||||
| "**/vssver.scc", | "**/vssver.scc", | ||||
| "**/.svn", | "**/.svn", | ||||
| "**/.svn/**", | "**/.svn/**", | ||||
| "**/.git", | |||||
| "**/.git/**", | |||||
| "**/.gitattributes", | |||||
| "**/.gitignore", | |||||
| "**/.gitmodules", | |||||
| "**/.hg", | |||||
| "**/.hg/**", | |||||
| "**/.hgignore", | |||||
| "**/.hgsub", | |||||
| "**/.hgsubstate", | |||||
| "**/.hgtags", | |||||
| "**/.bzr", | |||||
| "**/.bzr/**", | |||||
| "**/.bzrignore", | |||||
| "**/.DS_Store"}; | "**/.DS_Store"}; | ||||
| project.executeTarget("test3"); | project.executeTarget("test3"); | ||||
| assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes()); | assertEquals("current default excludes", expected, DirectoryScanner.getDefaultExcludes()); | ||||