diff options
Diffstat (limited to 'lorry')
-rwxr-xr-x | lorry | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -766,8 +766,30 @@ class Lorry(cliapp.Application): self.prune_unreachable_marks(gitdir, os.path.join(gitdir, 'hg2git-marks')) + # Enable the fudge_user_ids plugin if possible + plugin_options = [] + exit, out, _ = self.runcmd_unchecked(['hg-fast-export', '--help']) + if exit == 0 and b'--plugin' in out: + for plugin_path in [ + # Check under same directory as us, in case we are + # not yet installed + os.path.join(os.path.dirname(__file__), + 'hg-fast-export/plugins'), + # Try walking from <prefix>/bin/lorry to + # <prefix>/share/lorry/... + os.path.join(os.path.dirname(__file__), + '../share/lorry/hg-fast-export/plugins') + ]: + if os.path.exists(plugin_path): + plugin_options += [ + '--plugin-path', plugin_path, + '--plugin', 'fudge_user_ids' + ] + break + self.progress('.. fast-exporting into git') - self.run_program(['hg-fast-export', '-r', '../hg', '--quiet', '--force'], + self.run_program(['hg-fast-export', '-r', '../hg', '--quiet', '--force', + *plugin_options], cwd=gitdir) def gitify_archive(self, archive_type, project_name, dirname, gitdir, spec): |