{"thread":{"id":"32638","subject":"[PATCH] remote-hg: fix handling of file perms when pushing","startedAt":"2013-01-15T13:02:39Z","lastAt":"2013-01-15T23:51:53Z","messageCount":3,"participants":["Max Horn","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"206932","messageId":"1358254959-50435-1-git-send-email-max@quendi.de","threadId":"32638","inReplyTo":null,"subject":"[PATCH] remote-hg: fix handling of file perms when pushing","fromName":"Max Horn","fromEmail":"max@quendi.de","sentAt":"2013-01-15T13:02:39Z","receivedAt":"2013-01-15T13:02:39Z","isPatch":true,"sender":{"key":"max@quendi.de","avatar":"https://avatars.githubusercontent.com/u/241512?v=4"},"body":"Previously, when changing and committing an executable file, the file\nwould loose its executable bit on the hg side. Likewise, symlinks ended\nup as \"normal\" files\". This was not immediately apparent on the git side\nunless one did a fresh clone.\n---\n contrib/remote-helpers/git-remote-hg     |  2 +-\n contrib/remote-helpers/test-hg-hg-git.sh | 68 ++++++++++++++++++++++++++++++++\n 2 files changed, 69 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 7c74d8b..328c2dc 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -53,7 +53,7 @@ def gittz(tz):\n     return '%+03d%02d' % (-tz / 3600, -tz % 3600 / 60)\n \n def hgmode(mode):\n-    m = { '0100755': 'x', '0120000': 'l' }\n+    m = { '100755': 'x', '120000': 'l' }\n     return m.get(mode, '')\n \n def get_config(config):\ndiff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh\nindex 3e76d9f..7e3967f 100755\n--- a/contrib/remote-helpers/test-hg-hg-git.sh\n+++ b/contrib/remote-helpers/test-hg-hg-git.sh\n@@ -109,6 +109,74 @@ setup () {\n \n setup\n \n+test_expect_success 'executable bit' '\n+\tmkdir -p tmp && cd tmp &&\n+\ttest_when_finished \"cd .. && rm -rf tmp\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\techo alpha > alpha &&\n+\tchmod 0644 alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tchmod 0755 alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"set executable bit\" &&\n+\tchmod 0644 alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"clear executable bit\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\tcd hgrepo-$x &&\n+\t\thg_log . &&\n+\t\thg manifest -r 1 -v &&\n+\t\thg manifest -v\n+\t\t) > output-$x &&\n+\n+\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n+\t\tgit_log gitrepo2-$x > log-$x\n+\tdone &&\n+\tcp -r log-* output-* /tmp/foo/ &&\n+\n+\ttest_cmp output-hg output-git &&\n+\ttest_cmp log-hg log-git\n+'\n+\n+test_expect_success 'symlink' '\n+\tmkdir -p tmp && cd tmp &&\n+\ttest_when_finished \"cd .. && rm -rf tmp\" &&\n+\n+\t(\n+\tgit init -q gitrepo &&\n+\tcd gitrepo &&\n+\techo alpha > alpha &&\n+\tgit add alpha &&\n+\tgit commit -m \"add alpha\" &&\n+\tln -s alpha beta &&\n+\tgit add beta &&\n+\tgit commit -m \"add beta\"\n+\t) &&\n+\n+\tfor x in hg git; do\n+\t\t(\n+\t\thg_clone_$x gitrepo hgrepo-$x &&\n+\t\tcd hgrepo-$x &&\n+\t\thg_log . &&\n+\t\thg manifest -v\n+\t\t) > output-$x &&\n+\n+\t\tgit_clone_$x hgrepo-$x gitrepo2-$x &&\n+\t\tgit_log gitrepo2-$x > log-$x\n+\tdone &&\n+\n+\ttest_cmp output-hg output-git &&\n+\ttest_cmp log-hg log-git\n+'\n+\n test_expect_success 'merge conflict 1' '\n \tmkdir -p tmp && cd tmp &&\n \ttest_when_finished \"cd .. && rm -rf tmp\" &&\n-- \n1.8.1.448.g79c577a.dirty\n"},{"id":"206933","messageId":"1E49829A-0675-40D2-97C6-FD62982A0923@quendi.de","threadId":"32638","inReplyTo":"1358254959-50435-1-git-send-email-max@quendi.de","subject":"Re: [PATCH] remote-hg: fix handling of file perms when pushing","fromName":"Max Horn","fromEmail":"max@quendi.de","sentAt":"2013-01-15T13:06:57Z","receivedAt":"2013-01-15T13:06:57Z","isPatch":true,"sender":{"key":"max@quendi.de","avatar":"https://avatars.githubusercontent.com/u/241512?v=4"},"body":"\nOn 15.01.2013, at 14:02, Max Horn wrote:\n\n> Previously, when changing and committing an executable file, the file\n> would loose its executable bit on the hg side. Likewise, symlinks ended\n> up as \"normal\" files\". This was not immediately apparent on the git side\n> unless one did a fresh clone.\n\nSorry, forgot to sign off, please add:\n\nSigned-off-by: Max Horn <max@quendi.de>\n\nMax\n"},{"id":"206993","messageId":"7vfw220zty.fsf@alter.siamese.dyndns.org","threadId":"32638","inReplyTo":"1E49829A-0675-40D2-97C6-FD62982A0923@quendi.de","subject":"Re: [PATCH] remote-hg: fix handling of file perms when pushing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-15T23:51:53Z","receivedAt":"2013-01-15T23:51:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Max Horn <max@quendi.de> writes:\n\n> On 15.01.2013, at 14:02, Max Horn wrote:\n>\n>> Previously, when changing and committing an executable file, the file\n>> would loose its executable bit on the hg side. Likewise, symlinks ended\n>> up as \"normal\" files\". This was not immediately apparent on the git side\n>> unless one did a fresh clone.\n>\n> Sorry, forgot to sign off, please add:\n>\n> Signed-off-by: Max Horn <max@quendi.de>\n>\n> Max\n\nThanks; merged together with the other patch from Felipe to 'next'.\n\nUnfortunately I noticed the \"loose\" typo (I think you meant \"lose\")\nafter I pushed out the results X-<.\n"}]}