Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to find Utility/reconcile.py p4retypemap ? #10

Closed
perezd opened this issue Nov 17, 2020 · 1 comment
Closed

Where to find Utility/reconcile.py p4retypemap ? #10

perezd opened this issue Nov 17, 2020 · 1 comment

Comments

@perezd
Copy link

perezd commented Nov 17, 2020

Context: https://bebylon.dev/ue4guide/source-control/perforce-source-version-control-setup/

References a Utility for retypemapping files, where does this live? I'd like to use it.

Thanks!

@ikrima
Copy link
Owner

ikrima commented Nov 18, 2020

Ah, good catch. that's part of the internal K&L devops/build scripts. There's probably still various references to internal scripts but called it out on that page.

For the retyping, it's mostly orthogonal to our internal environment so you can probably easily reuse it. It just parses the typemap and calls the p4 command. Pasted here below:

@reconcilegroup.command()
@click.option('--srcdir',
              type=click.Path(exists=True),
              default=klcommon.GetKLConfig()[1].BBRDir,
              show_default=True,
              help='''Directory to retypemap''')
def p4retypemap(srcdir):
    """Not for general use. Utility to apply a typemap spec to existing files in a depot."""
    klcommon.printTitle('BBR P4 Retypemap')

    error, klcfg = klcommon.GetKLConfig()
    if error: raise click.Abort()

    with klcommon.pushd(srcdir):
        import subprocess
        output = subprocess.check_output("p4 typemap -o", shell=True)
        for typemap in output.rpartition('TypeMap:')[-1].splitlines():
            if typemap:
                if klcommon.launch(f"p4 retype -t {typemap}", False) != 0:
                    raise click.Abort()

@ikrima ikrima closed this as completed Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants