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

Re: Git p4 sync changelist interval

From
Luke Diamand <luke@diamand.org>
Date
Jun 6, 2017, 07:49 UTC
Message-ID
<CAE5ih7-+EzUhjXCCOu_oELof_2X_qf5snoqUZyuRNqEu+p=ewg@mail.gmail.com>
In-Reply-To
<CAE5ih7_yt4zjju3F34gUTKLPip9T98ow=shZY7EPe3yE8gk32Q@mail.gmail.com>
On 6 June 2017 at 08:00, Luke Diamand <luke@diamand.org> wrote:
Show 35 quoted lines
> On 6 June 2017 at 00:29, Luke Diamand <luke@diamand.org> wrote:
>> On 5 June 2017 at 19:50, Андрей Ефанов <1134togo@gmail.com> wrote:
>>> 2017-06-04 14:09 GMT+03:00 Luke Diamand <luke@diamand.org>:
>>>>
>>>>
>>>> >
>>>> > The problem, as I see it, is that before syncing changes in the given
>>>> > range, p4 task does not sync to cl1 version of the repo, and applies
>>>> > commits to the empty repository.
>>>> > Is it a bug or my misunderstanding of how git p4 should work?
>>>>
>>>> Possibly I'm misunderstanding what you're doing! Can you give a
>>>> sequence of steps to show the problem?
>>>
>>> What I meant is:
>>>
>>> 1. Create p4 depot
>>> 2. Add first.file (CL 2)
>>> 3. Add second.file (at CL 3)
>>> 4. Add third.file (at CL 4)
>>> 5. Modify first.file (at CL 5)
>>> 4. git-p4 clone //depot@3,5
>>>
>>> In this case first.file, will not be represented in the repository.
>>
>> Hmmm, it's not working right for me. Although in my case I seem to be
>> missing the second file.
>>
>> It's fine if I don't use the revision range "3,5".
>
> It's also fine if I do:
>
> git p4 sync //depot@3
> cd depot
> git p4 rebase
It seems to be something to do with the code around line 3395 that says:
    if self.changeRange == "@all":
        self.changeRange = ""
    elif ',' not in self.changeRange:

It's finding a lower revision number with which to later call importHeadRevision(), but that only seems to be called if the revision range does *not* have a "," in it. As a result, we never actually call importHeadRevision() and so files end up missing.

The obvious fix of fishing out the "@3" from the "@3,5" revision range works in this instance, but breaks some of the regression tests.

Luke
Previous: Luke DiamandNext: Андрей Ефанов
Message 6 of 8 in “Git p4 sync changelist interval”
  1. Андрей ЕфановJun 4, 2017
  2. Luke DiamandJun 4, 2017
  3. Fwd: Git p4 sync changelist intervalАндрей Ефанов, Jun 5, 2017
  4. Luke DiamandJun 5, 2017
  5. Luke DiamandJun 6, 2017
  6. Luke DiamandJun 6, 2017
  7. Андрей ЕфановJun 6, 2017
  8. Luke DiamandJun 6, 2017

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.