git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-p4: support exclusively locked files

From
PWPete Wyckoff <pw@padd.com>
Date
Mar 17, 2013, 20:04 UTC
Message-ID
<20130317200437.GA29115@padd.com>
In-Reply-To
<CD666D0F.1DC6E%danny.thomas@blackboard.com>
Danny.Thomas@blackboard.com wrote on Wed, 13 Mar 2013 13:51 -0400:
Show 9 quoted lines
> By default, newly added binary files are exclusively locked by Perforce:
> 
> 'add default change (binary+l) *exclusive*'
> 
> This results in a 'Could not determine file type' error as the regex
> expects
> the line to end after the file type matching group. Some repositories are
> also configured to always require exclusive locks, so may be a problem for
> all revisions in some cases.

Can you explain how to configure p4d to default everything to binary+l? Also, what version are you using ("p4 info")? I'm trying to write a test case for this.

I did find a way to play with typemap to get +l, as:
    ( p4 typemap -o ; printf "\tbinary+l\t//.../bash*" ) | p4 typemap -i
With this, the 2011.1 here just says:
    tic-git-test$ p4 opened bash
    //depot/bash#1 - add default change (binary+l)
I've not been able to make it say " *exclusive*" too.
>      result = p4_read_pipe(["opened", wildcard_encode(file)])
> -    match = re.match(".*\((.+)\)\r?$", result)
> +    match = re.match(".*\((.+)\)(?:.+)?\r?$", result)

I think this whole function would be less brittle using p4's "-G" output, like:

    d = p4Cmd(["fstat", "-T", "type", wildcard_encode(file)])
    # some error checking
    return d['type']

But I'm curious if your p4d includes " *exclusive*" in the type there too, in which case we'll have to strip it.

Thanks for starting the patch on this. It's good if we can keep others from running into the same problem.

		-- Pete
Previous: Danny ThomasNext: Danny Thomas
Message 2 of 6 in “git-p4: support exclusively locked files”
  1. git-p4: support exclusively locked filesDanny Thomas, Mar 13, 2013
  2. Pete WyckoffMar 17, 2013
  3. Danny ThomasMar 18, 2013
  4. Pete WyckoffMar 19, 2013
  5. Danny ThomasMar 20, 2013
  6. Pete WyckoffMar 24, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.