From: Junio C Hamano Date: Tue, 22 Jan 2013 04:15:40 +0000 (-0800) Subject: Merge branch 'mh/remote-hg-mode-bits-fix' X-Git-Tag: v1.8.2-rc0~102 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/864b5c41e472f2411d11620d3841b2b0dfceb9ec?ds=inline;hp=-c Merge branch 'mh/remote-hg-mode-bits-fix' Update to the Hg remote helper (in contrib/). * mh/remote-hg-mode-bits-fix: remote-hg: fix handling of file perms when pushing --- 864b5c41e472f2411d11620d3841b2b0dfceb9ec diff --combined contrib/remote-helpers/git-remote-hg index 7c74d8bfdc,5974976f02..328c2dc76d --- a/contrib/remote-helpers/git-remote-hg +++ b/contrib/remote-helpers/git-remote-hg @@@ -53,7 -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): @@@ -720,14 -720,6 +720,14 @@@ def do_export(parser) if peer: parser.repo.push(peer, force=False) +def fix_path(alias, repo, orig_url): + repo_url = util.url(repo.url()) + url = util.url(orig_url) + if str(url) == str(repo_url): + return + cmd = ['git', 'config', 'remote.%s.url' % alias, "hg::%s" % repo_url] + subprocess.call(cmd) + def main(args): global prefix, dirname, branches, bmarks global marks, blob_marks, parsed_refs @@@ -774,9 -766,6 +774,9 @@@ repo = get_repo(url, alias) prefix = 'refs/hg/%s' % alias + if not is_tmp: + fix_path(alias, peer or repo, url) + if not os.path.exists(dirname): os.makedirs(dirname)