* [PATCH] remote-hg: fix handling of file perms when pushing
@ 2013-01-15 13:02 Max Horn
2013-01-15 13:06 ` Max Horn
0 siblings, 1 reply; 3+ messages in thread
From: Max Horn @ 2013-01-15 13:02 UTC (permalink / raw)
To: git; +Cc: Felipe Contreras, Max Horn
Previously, when changing and committing an executable file, the file
would loose its executable bit on the hg side. Likewise, symlinks ended
up as "normal" files". This was not immediately apparent on the git side
unless one did a fresh clone.
---
contrib/remote-helpers/git-remote-hg | 2 +-
contrib/remote-helpers/test-hg-hg-git.sh | 68 ++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+), 1 deletion(-)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 7c74d8b..328c2dc 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -53,7 +53,7 @@ def gittz(tz):
return '%+03d%02d' % (-tz / 3600, -tz % 3600 / 60)
def hgmode(mode):
- m = { '0100755': 'x', '0120000': 'l' }
+ m = { '100755': 'x', '120000': 'l' }
return m.get(mode, '')
def get_config(config):
diff --git a/contrib/remote-helpers/test-hg-hg-git.sh b/contrib/remote-helpers/test-hg-hg-git.sh
index 3e76d9f..7e3967f 100755
--- a/contrib/remote-helpers/test-hg-hg-git.sh
+++ b/contrib/remote-helpers/test-hg-hg-git.sh
@@ -109,6 +109,74 @@ setup () {
setup
+test_expect_success 'executable bit' '
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ (
+ git init -q gitrepo &&
+ cd gitrepo &&
+ echo alpha > alpha &&
+ chmod 0644 alpha &&
+ git add alpha &&
+ git commit -m "add alpha" &&
+ chmod 0755 alpha &&
+ git add alpha &&
+ git commit -m "set executable bit" &&
+ chmod 0644 alpha &&
+ git add alpha &&
+ git commit -m "clear executable bit"
+ ) &&
+
+ for x in hg git; do
+ (
+ hg_clone_$x gitrepo hgrepo-$x &&
+ cd hgrepo-$x &&
+ hg_log . &&
+ hg manifest -r 1 -v &&
+ hg manifest -v
+ ) > output-$x &&
+
+ git_clone_$x hgrepo-$x gitrepo2-$x &&
+ git_log gitrepo2-$x > log-$x
+ done &&
+ cp -r log-* output-* /tmp/foo/ &&
+
+ test_cmp output-hg output-git &&
+ test_cmp log-hg log-git
+'
+
+test_expect_success 'symlink' '
+ mkdir -p tmp && cd tmp &&
+ test_when_finished "cd .. && rm -rf tmp" &&
+
+ (
+ git init -q gitrepo &&
+ cd gitrepo &&
+ echo alpha > alpha &&
+ git add alpha &&
+ git commit -m "add alpha" &&
+ ln -s alpha beta &&
+ git add beta &&
+ git commit -m "add beta"
+ ) &&
+
+ for x in hg git; do
+ (
+ hg_clone_$x gitrepo hgrepo-$x &&
+ cd hgrepo-$x &&
+ hg_log . &&
+ hg manifest -v
+ ) > output-$x &&
+
+ git_clone_$x hgrepo-$x gitrepo2-$x &&
+ git_log gitrepo2-$x > log-$x
+ done &&
+
+ test_cmp output-hg output-git &&
+ test_cmp log-hg log-git
+'
+
test_expect_success 'merge conflict 1' '
mkdir -p tmp && cd tmp &&
test_when_finished "cd .. && rm -rf tmp" &&
--
1.8.1.448.g79c577a.dirty
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] remote-hg: fix handling of file perms when pushing
2013-01-15 13:02 [PATCH] remote-hg: fix handling of file perms when pushing Max Horn
@ 2013-01-15 13:06 ` Max Horn
2013-01-15 23:51 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Max Horn @ 2013-01-15 13:06 UTC (permalink / raw)
To: Max Horn; +Cc: git, Felipe Contreras
On 15.01.2013, at 14:02, Max Horn wrote:
> Previously, when changing and committing an executable file, the file
> would loose its executable bit on the hg side. Likewise, symlinks ended
> up as "normal" files". This was not immediately apparent on the git side
> unless one did a fresh clone.
Sorry, forgot to sign off, please add:
Signed-off-by: Max Horn <max@quendi.de>
Max
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] remote-hg: fix handling of file perms when pushing
2013-01-15 13:06 ` Max Horn
@ 2013-01-15 23:51 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2013-01-15 23:51 UTC (permalink / raw)
To: Max Horn; +Cc: git, Felipe Contreras
Max Horn <max@quendi.de> writes:
> On 15.01.2013, at 14:02, Max Horn wrote:
>
>> Previously, when changing and committing an executable file, the file
>> would loose its executable bit on the hg side. Likewise, symlinks ended
>> up as "normal" files". This was not immediately apparent on the git side
>> unless one did a fresh clone.
>
> Sorry, forgot to sign off, please add:
>
> Signed-off-by: Max Horn <max@quendi.de>
>
> Max
Thanks; merged together with the other patch from Felipe to 'next'.
Unfortunately I noticed the "loose" typo (I think you meant "lose")
after I pushed out the results X-<.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-15 23:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15 13:02 [PATCH] remote-hg: fix handling of file perms when pushing Max Horn
2013-01-15 13:06 ` Max Horn
2013-01-15 23:51 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox