D7900: merge: avoid a negation in the definition of updatedirstate

2020-01-24 Thread martinvonz (Martin von Zweigbergk)
Closed by commit rHGfaec51c76b7b: merge: avoid a negation in the definition of 
updatedirstate (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7900?vs=19554=19577

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7900/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7900

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2501,13 +2501,9 @@
 if not branchmerge:  # just jump to the new rev
 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b''
 # If we're doing a partial update, we need to skip updating
-# the dirstate, so make a note of any partial-ness to the
-# update here.
-if matcher is None or matcher.always():
-partial = False
-else:
-partial = True
-updatedirstate = not partial and not wc.isinmemory()
+# the dirstate.
+always = matcher is None or matcher.always()
+updatedirstate = always and not wc.isinmemory()
 if updatedirstate:
 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2)
 # note that we're in the middle of an update



To: martinvonz, #hg-reviewers, pulkit
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7900: merge: avoid a negation in the definition of updatedirstate

2020-01-24 Thread martinvonz (Martin von Zweigbergk)
martinvonz marked an inline comment as done.
martinvonz updated this revision to Diff 19554.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7900?vs=19336=19554

BRANCH
  default

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7900/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7900

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2501,13 +2501,9 @@
 if not branchmerge:  # just jump to the new rev
 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b''
 # If we're doing a partial update, we need to skip updating
-# the dirstate, so make a note of any partial-ness to the
-# update here.
-if matcher is None or matcher.always():
-partial = False
-else:
-partial = True
-updatedirstate = not partial and not wc.isinmemory()
+# the dirstate.
+always = matcher is None or matcher.always()
+updatedirstate = always and not wc.isinmemory()
 if updatedirstate:
 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2)
 # note that we're in the middle of an update



To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7900: merge: avoid a negation in the definition of updatedirstate

2020-01-24 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.
martinvonz marked an inline comment as done.

INLINE COMMENTS

> pulkit wrote in merge.py:2291
> This comment now looks misplaced.

I'll insert another patch before this one to help with that.

Unrelated to your comment, I'll also reorder D7901 
 and D7902 
 because I think D7902 
 is less controversial.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7900/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7900

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7900: merge: avoid a negation in the definition of updatedirstate

2020-01-24 Thread pulkit (Pulkit Goyal)
pulkit added inline comments.

INLINE COMMENTS

> merge.py:2291
>  )
>  # If we're doing a partial update, we need to skip updating
>  # the dirstate, so make a note of any partial-ness to the

This comment now looks misplaced.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7900/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7900

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7900: merge: avoid a negation in the definition of updatedirstate

2020-01-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We only use `partial` in one place: the definition of
  `updatedirstate`. Let's simplify that a little.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7900

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2291,10 +2291,7 @@
 # If we're doing a partial update, we need to skip updating
 # the dirstate, so make a note of any partial-ness to the
 # update here.
-if matcher is None or matcher.always():
-partial = False
-else:
-partial = True
+always = matcher is None or matcher.always()
 with repo.wlock():
 if wc is None:
 wc = repo[None]
@@ -2507,7 +2504,7 @@
 ### apply phase
 if not branchmerge:  # just jump to the new rev
 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b''
-updatedirstate = not partial and not wc.isinmemory()
+updatedirstate = always and not wc.isinmemory()
 if updatedirstate:
 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2)
 # note that we're in the middle of an update



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel