Commit f8ae0b89 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Fixing HgGitRepository#create_from_bundle

As the name suggests, it must create the repo.
Also `for_write` is really useful, prevents potentially
harmful hooks to be fired, notably.

branch : heptapod
parent ac73aa1d3c2d
......@@ -522,7 +522,7 @@ def hg_call(args, user, path, env: nil, for_write: false,
unless username.nil?
cmd.extend(['--config', 'ui.username=' + username])
cmd.append('--config', 'ui.username=' + username)
output, status = popen(cmd, path, env)
......@@ -991,9 +991,17 @@ def backup_config(save_path)
# actual paths for Mercurial (bundle and config) are deduced from it
# See also doc-comment for #bundle_to_disk.
def create_from_bundle(path_to_bundle)
# same path used as cwd as in hg_create_repository()
# we don't know namespace arguments that would be used to
# call the latter, but it doesn't matter, since all config will
# be restored
hg_call(["init", @hgpath], nil, @hg_storage_root,
for_write: true, force_system_user: true)
hg_call(["unbundle", hg_bundle_path(path_to_bundle)],
nil, @hgpath, force_system_user: true)
hg_call(["unbundle", hg_bundle_path(path_to_bundle)], nil, @hgpath,
for_write: true, force_system_user: true)
def restore_config(path_to_bundle)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment