From ac302d3125907e64f98823473511dd8ea5aaa8f0 Mon Sep 17 00:00:00 2001 From: m00nlight Date: Mon, 29 Dec 2014 11:16:39 +0800 Subject: [PATCH 1/3] Add hgignore for programmer prefer mercurial DRCS --- leiningen-core/pom.xml | 23 +++++++---------------- resources/leiningen/new/app/hgignore | 10 ++++++++++ resources/leiningen/new/default/hgignore | 10 ++++++++++ resources/leiningen/new/plugin/hgignore | 10 ++++++++++ resources/leiningen/new/template/hgignore | 10 ++++++++++ src/leiningen/new/app.clj | 1 + src/leiningen/new/default.clj | 1 + src/leiningen/new/plugin.clj | 1 + src/leiningen/new/template.clj | 1 + test/leiningen/test/new.clj | 22 +++++++++++----------- 10 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 resources/leiningen/new/app/hgignore create mode 100644 resources/leiningen/new/default/hgignore create mode 100644 resources/leiningen/new/plugin/hgignore create mode 100644 resources/leiningen/new/template/hgignore diff --git a/leiningen-core/pom.xml b/leiningen-core/pom.xml index 8b66b7e6f..f269d6513 100644 --- a/leiningen-core/pom.xml +++ b/leiningen-core/pom.xml @@ -14,27 +14,21 @@ - scm:git:git://github.com/technomancy/leiningen.git - scm:git:ssh://git@github.com/technomancy/leiningen.git - e77db48947ee47e7ee0c1e4b8f5e43764e3aa3b7 + scm:git:git://github.com/m00nlight/leiningen.git + scm:git:ssh://git@github.com/m00nlight/leiningen.git + 1f324dad13addb09b3ab54254c0a72a560b7ef78 - https://github.com/technomancy/leiningen + https://github.com/m00nlight/leiningen src test - - dev-resources - resources - - dev-resources - dev-resources @@ -49,7 +43,7 @@ central - http://repo1.maven.org/maven2/ + https://repo1.maven.org/maven2/ false @@ -104,11 +98,6 @@ io 0.3.1 - - spyscope - spyscope - 0.1.4 - pedantic pedantic @@ -124,6 +113,7 @@ clojure + test clojure-complete @@ -135,6 +125,7 @@ clojure + test diff --git a/resources/leiningen/new/app/hgignore b/resources/leiningen/new/app/hgignore new file mode 100644 index 000000000..3bf99fc89 --- /dev/null +++ b/resources/leiningen/new/app/hgignore @@ -0,0 +1,10 @@ +syntax: glob +/target/ +/classes/ +/checkouts/ +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port \ 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..3bf99fc89 --- /dev/null +++ b/resources/leiningen/new/default/hgignore @@ -0,0 +1,10 @@ +syntax: glob +/target/ +/classes/ +/checkouts/ +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port \ 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..3bf99fc89 --- /dev/null +++ b/resources/leiningen/new/plugin/hgignore @@ -0,0 +1,10 @@ +syntax: glob +/target/ +/classes/ +/checkouts/ +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port \ 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..3bf99fc89 --- /dev/null +++ b/resources/leiningen/new/template/hgignore @@ -0,0 +1,10 @@ +syntax: glob +/target/ +/classes/ +/checkouts/ +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port \ 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))) From e97c36084b5e30b7c358cfe18bc960e817fdc5ab Mon Sep 17 00:00:00 2001 From: m00nlight Date: Mon, 29 Dec 2014 11:33:08 +0800 Subject: [PATCH 2/3] Add gitignore to ignore all mercurial related files and hgignore all git related files --- resources/leiningen/new/app/gitignore | 4 +++- resources/leiningen/new/app/hgignore | 10 ++++++---- resources/leiningen/new/default/gitignore | 4 +++- resources/leiningen/new/default/hgignore | 10 ++++++---- resources/leiningen/new/plugin/gitignore | 4 +++- resources/leiningen/new/plugin/hgignore | 10 ++++++---- resources/leiningen/new/template/gitignore | 4 +++- resources/leiningen/new/template/hgignore | 10 ++++++---- 8 files changed, 36 insertions(+), 20 deletions(-) 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 index 3bf99fc89..8881fab1b 100644 --- a/resources/leiningen/new/app/hgignore +++ b/resources/leiningen/new/app/hgignore @@ -1,10 +1,12 @@ syntax: glob -/target/ -/classes/ -/checkouts/ +target/** +classes/** +checkouts/** pom.xml pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.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 index 3bf99fc89..8881fab1b 100644 --- a/resources/leiningen/new/default/hgignore +++ b/resources/leiningen/new/default/hgignore @@ -1,10 +1,12 @@ syntax: glob -/target/ -/classes/ -/checkouts/ +target/** +classes/** +checkouts/** pom.xml pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.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 index 3bf99fc89..8881fab1b 100644 --- a/resources/leiningen/new/plugin/hgignore +++ b/resources/leiningen/new/plugin/hgignore @@ -1,10 +1,12 @@ syntax: glob -/target/ -/classes/ -/checkouts/ +target/** +classes/** +checkouts/** pom.xml pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.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 index 3bf99fc89..8881fab1b 100644 --- a/resources/leiningen/new/template/hgignore +++ b/resources/leiningen/new/template/hgignore @@ -1,10 +1,12 @@ syntax: glob -/target/ -/classes/ -/checkouts/ +target/** +classes/** +checkouts/** pom.xml pom.xml.asc *.jar *.class /.lein-* -/.nrepl-port \ No newline at end of file +/.nrepl-port +.gitignore +.git/** \ No newline at end of file From 09c82721243c6360673682ae51284c2b0b1e61bd Mon Sep 17 00:00:00 2001 From: m00nlight Date: Mon, 29 Dec 2014 14:22:54 -0800 Subject: [PATCH 3/3] remove pom changes --- leiningen-core/pom.xml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/leiningen-core/pom.xml b/leiningen-core/pom.xml index f269d6513..8b66b7e6f 100644 --- a/leiningen-core/pom.xml +++ b/leiningen-core/pom.xml @@ -14,21 +14,27 @@ - scm:git:git://github.com/m00nlight/leiningen.git - scm:git:ssh://git@github.com/m00nlight/leiningen.git - 1f324dad13addb09b3ab54254c0a72a560b7ef78 + scm:git:git://github.com/technomancy/leiningen.git + scm:git:ssh://git@github.com/technomancy/leiningen.git + e77db48947ee47e7ee0c1e4b8f5e43764e3aa3b7 - https://github.com/m00nlight/leiningen + https://github.com/technomancy/leiningen src test + + dev-resources + resources + + dev-resources + dev-resources @@ -43,7 +49,7 @@ central - https://repo1.maven.org/maven2/ + http://repo1.maven.org/maven2/ false @@ -98,6 +104,11 @@ io 0.3.1 + + spyscope + spyscope + 0.1.4 + pedantic pedantic @@ -113,7 +124,6 @@ clojure - test clojure-complete @@ -125,7 +135,6 @@ clojure - test