Skip to content

Commit

Permalink
Merge branch 'mh/remote-hg-mode-bits-fix'
Browse files Browse the repository at this point in the history
Update to the Hg remote helper (in contrib/).

* mh/remote-hg-mode-bits-fix:
  remote-hg: fix handling of file perms when pushing
  • Loading branch information
Junio C Hamano committed Jan 22, 2013
2 parents 9a69ef1 + 3968e30 commit 864b5c4
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/remote-helpers/git-remote-hg
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
68 changes: 68 additions & 0 deletions contrib/remote-helpers/test-hg-hg-git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" &&
Expand Down

0 comments on commit 864b5c4

Please sign in to comment.