diff --git a/resources/leiningen/new/app/gitignore b/resources/leiningen/new/app/gitignore index 9499b43d8..708f60f6e 100644 --- a/resources/leiningen/new/app/gitignore +++ b/resources/leiningen/new/app/gitignore @@ -6,4 +6,6 @@ pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.nrepl-port +.hgignore +.hg/ \ No newline at end of file diff --git a/resources/leiningen/new/app/hgignore b/resources/leiningen/new/app/hgignore new file mode 100644 index 000000000..8881fab1b --- /dev/null +++ b/resources/leiningen/new/app/hgignore @@ -0,0 +1,12 @@ +syntax: glob +target/** +classes/** +checkouts/** +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.gitignore +.git/** \ No newline at end of file diff --git a/resources/leiningen/new/default/gitignore b/resources/leiningen/new/default/gitignore index 9499b43d8..708f60f6e 100644 --- a/resources/leiningen/new/default/gitignore +++ b/resources/leiningen/new/default/gitignore @@ -6,4 +6,6 @@ pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.nrepl-port +.hgignore +.hg/ \ No newline at end of file diff --git a/resources/leiningen/new/default/hgignore b/resources/leiningen/new/default/hgignore new file mode 100644 index 000000000..8881fab1b --- /dev/null +++ b/resources/leiningen/new/default/hgignore @@ -0,0 +1,12 @@ +syntax: glob +target/** +classes/** +checkouts/** +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.gitignore +.git/** \ No newline at end of file diff --git a/resources/leiningen/new/plugin/gitignore b/resources/leiningen/new/plugin/gitignore index 9499b43d8..708f60f6e 100644 --- a/resources/leiningen/new/plugin/gitignore +++ b/resources/leiningen/new/plugin/gitignore @@ -6,4 +6,6 @@ pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.nrepl-port +.hgignore +.hg/ \ No newline at end of file diff --git a/resources/leiningen/new/plugin/hgignore b/resources/leiningen/new/plugin/hgignore new file mode 100644 index 000000000..8881fab1b --- /dev/null +++ b/resources/leiningen/new/plugin/hgignore @@ -0,0 +1,12 @@ +syntax: glob +target/** +classes/** +checkouts/** +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.gitignore +.git/** \ No newline at end of file diff --git a/resources/leiningen/new/template/gitignore b/resources/leiningen/new/template/gitignore index 9499b43d8..708f60f6e 100644 --- a/resources/leiningen/new/template/gitignore +++ b/resources/leiningen/new/template/gitignore @@ -6,4 +6,6 @@ pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.nrepl-port +.hgignore +.hg/ \ No newline at end of file diff --git a/resources/leiningen/new/template/hgignore b/resources/leiningen/new/template/hgignore new file mode 100644 index 000000000..8881fab1b --- /dev/null +++ b/resources/leiningen/new/template/hgignore @@ -0,0 +1,12 @@ +syntax: glob +target/** +classes/** +checkouts/** +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.gitignore +.git/** \ No newline at end of file diff --git a/src/leiningen/new/app.clj b/src/leiningen/new/app.clj index c4ff450b8..bce27d414 100644 --- a/src/leiningen/new/app.clj +++ b/src/leiningen/new/app.clj @@ -21,6 +21,7 @@ ["README.md" (render "README.md" data)] ["doc/intro.md" (render "intro.md" data)] [".gitignore" (render "gitignore" data)] + [".hgignore" (render "hgignore" data)] ["src/{{nested-dirs}}.clj" (render "core.clj" data)] ["test/{{nested-dirs}}_test.clj" (render "test.clj" data)] ["LICENSE" (render "LICENSE" data)] diff --git a/src/leiningen/new/default.clj b/src/leiningen/new/default.clj index 88633b348..f9a8b1926 100644 --- a/src/leiningen/new/default.clj +++ b/src/leiningen/new/default.clj @@ -25,6 +25,7 @@ Accepts a group id in the project name: `lein new foo.bar/baz`" ["README.md" (render "README.md" data)] ["doc/intro.md" (render "intro.md" data)] [".gitignore" (render "gitignore" data)] + [".hgignore" (render "hgignore" data)] ["src/{{nested-dirs}}.clj" (render "core.clj" data)] ["test/{{nested-dirs}}_test.clj" (render "test.clj" data)] ["LICENSE" (render "LICENSE" data)] diff --git a/src/leiningen/new/plugin.clj b/src/leiningen/new/plugin.clj index 459507130..9a12cff7c 100644 --- a/src/leiningen/new/plugin.clj +++ b/src/leiningen/new/plugin.clj @@ -18,5 +18,6 @@ ["project.clj" (render "project.clj" data)] ["README.md" (render "README.md" data)] [".gitignore" (render "gitignore" data)] + [".hgignore" (render "hgignore" data)] ["src/leiningen/{{sanitized}}.clj" (render "name.clj" data)] ["LICENSE" (render "LICENSE" data)]))) diff --git a/src/leiningen/new/template.clj b/src/leiningen/new/template.clj index e2ec9f9c5..e1e37086f 100644 --- a/src/leiningen/new/template.clj +++ b/src/leiningen/new/template.clj @@ -15,6 +15,7 @@ ["README.md" (render "README.md" data)] ["project.clj" (render "project.clj" data)] [".gitignore" (render "gitignore" data)] + [".hgignore" (render "hgignore" data)] ["src/leiningen/new/{{sanitized}}.clj" (render "temp.clj" data)] ["resources/leiningen/new/{{sanitized}}/foo.clj" (render "foo.clj")] ["LICENSE" (render "LICENSE" data)]))) diff --git a/test/leiningen/test/new.clj b/test/leiningen/test/new.clj index 147206e1d..e31c25886 100644 --- a/test/leiningen/test/new.clj +++ b/test/leiningen/test/new.clj @@ -7,8 +7,8 @@ (deftest test-new-with-just-project-name (leiningen.new/new nil "test-new-proj") (is (= #{"README.md" "project.clj" "resources" "src" "core.clj" "test" - "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" - "LICENSE"} + "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" + ".hgignore" "LICENSE"} (set (map (memfn getName) (rest (file-seq (file "test-new-proj"))))))) (delete-file-recursively (file "test-new-proj") :silently)) @@ -16,7 +16,7 @@ (leiningen.new/new nil "orgname/a-project") (is (= #{"src" "a_project_test.clj" "project.clj" "a_project.clj" "orgname" "resources" "test" ".gitignore" "README.md" "doc" "intro.md" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "a-project"))))))) (delete-file-recursively (file "a-project") :silently)) @@ -25,7 +25,7 @@ (leiningen.new/new nil "default" "test-new-proj") (is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources" "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "test-new-proj"))))))) (delete-file-recursively (file "test-new-proj") :silently)) @@ -33,14 +33,14 @@ (leiningen.new/new nil "app" "test-new-app") (is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources" "doc" "intro.md" "test_new_app" "core_test.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "test-new-app"))))))) (delete-file-recursively (file "test-new-app") :silently)) (deftest test-new-with-plugin-template (leiningen.new/new nil "plugin" "test-new-plugin") (is (= #{"README.md" "project.clj" "src" "leiningen" "test_new_plugin.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "test-new-plugin"))))))) (delete-file-recursively (file "test-new-plugin") :silently)) @@ -48,7 +48,7 @@ (leiningen.new/new nil "template" "test-new-template") (is (= #{"README.md" "project.clj" "src" "leiningen" "new" "resources" "test_new_template.clj" "test_new_template" "foo.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "test-new-template"))))))) (delete-file-recursively (file "test-new-template") :silently)) @@ -84,7 +84,7 @@ (leiningen.new/new nil "test-new-proj" "--to-dir" "my-proj") (is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources" "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "my-proj"))))))) (delete-file-recursively (file "my-proj") :silently)) @@ -93,7 +93,7 @@ (leiningen.new/new nil "test-new-proj" "--force") (is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources" "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "test-new-proj"))))))) (delete-file-recursively (file "test-new-proj") :silently)) @@ -102,7 +102,7 @@ (leiningen.new/new nil "test-new-proj" "--to-dir" "my-proj" "--force") (is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources" "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file "my-proj"))))))) (delete-file-recursively (file "my-proj") :silently)) @@ -117,7 +117,7 @@ (leiningen.new/new nil "test-new-proj") (is (= #{"README.md" "project.clj" "src" "core.clj" "test" "resources" "doc" "intro.md" "test_new_proj" "core_test.clj" ".gitignore" - "LICENSE"} + "LICENSE" ".hgignore"} (set (map (memfn getName) (rest (file-seq (file new-pwd "test-new-proj"))))))) (System/setProperty "leiningen.original.pwd" original-pwd) (delete-file-recursively (file new-pwd) :silently)))