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

Re: [RFC PATCH] Record a single transaction for conflicting push operations

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Dec 20, 2009, 23:21 UTC
Message-ID
<b0943d9e0912201521k73bdcb5fl333e845028954050@mail.gmail.com>
In-Reply-To
<b8197bcb0912191550u300a9c20o351eba66c85292bb@mail.gmail.com>
2009/12/19 Karl Wiberg <kha@treskal.com>:
Show 21 quoted lines
> On Fri, Dec 18, 2009 at 4:49 PM, Catalin Marinas
> <catalin.marinas@gmail.com> wrote:
>
>> @@ -371,12 +369,10 @@ class StackTransaction(object):
>>             # We've just caused conflicts, so we must allow them in
>>             # the final checkout.
>>             self.__allow_conflicts = lambda trans: True
>> -
>> -            # Save this update so that we can run it a little later.
>> -            self.__conflicting_push = update
>> +            self.__patches = _TransPatchMap(self.__stack)
>> +            update()
>>             self.__halt("%d merge conflict(s)" % len(self.__conflicts))
>>         else:
>> -            # Update immediately.
>>             update()
>>
>>     def push_tree(self, pn):
>
> Better. But couldn't you remove the update function completely and
> just inline the code in it, since it's called immediately?

Of course, I tried, but couldn't get it to work. I get HEAD and top not equal unless I call update() between _TransPatchMap and self.__halt(). For the non-conflicting case we need to call update before or after this "if merge_conflict".

One solution is to split the "if merge_conflict" in two but maybe you have a better idea.

Thanks,
-- 
Catalin
Previous: Karl WibergNext: Karl Wiberg
Message 5 of 10 in “Record a single transaction for conflicting push operations”
  1. Record a single transaction for conflicting push operationsCatalin Marinas, Dec 17, 2009
  2. Karl WibergDec 18, 2009
  3. Catalin MarinasDec 18, 2009
  4. Karl WibergDec 19, 2009
  5. Catalin MarinasDec 20, 2009
  6. Karl WibergDec 21, 2009
  7. Catalin MarinasDec 21, 2009
  8. Karl WibergDec 21, 2009
  9. Gustav HållbergDec 21, 2009
  10. Catalin MarinasDec 22, 2009

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.