D8398: fastexport: fix diagnostics

2020-04-10 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/fastexport.py
  tests/test-fastexport.t

CHANGE DETAILS

diff --git a/tests/test-fastexport.t b/tests/test-fastexport.t
--- a/tests/test-fastexport.t
+++ b/tests/test-fastexport.t
@@ -853,3 +853,13 @@
   M 644 :5 nf1
   M 644 :6 of
   
+  $ echo foo > of
+  $ hg commit --user ' ' --date 'Fri Jan 02 00:00:00 1970 
+' -m 'Testcommit'
+  $ hg fastexport --import-marks fastexport.marks -r tip
+  blob
+  mark :50
+  data 4
+  foo
+  
+  abort: Unable to parse user into person and email for revision 
4f71ca786403919cd16669d94ff7cd1c09437a44
+  [255]
diff --git a/hgext/fastexport.py b/hgext/fastexport.py
--- a/hgext/fastexport.py
+++ b/hgext/fastexport.py
@@ -33,7 +33,6 @@
 GIT_PERSON_PROHIBITED = re.compile(b'[<>\n"]')
 GIT_EMAIL_PROHIBITED = re.compile(b"[<> \n]")
 
-
 def convert_to_git_user(authormap, user, rev):
 mapped_user = authormap.get(user, user)
 user_person = stringutil.person(mapped_user)
@@ -42,7 +41,8 @@
 user_person
 ):
 raise error.Abort(
-_(b"Unable to parse user into person and email for revision " + 
rev)
+_(b"Unable to parse user into person and email for revision %s")
+% pycompat.bytestr(rev)
 )
 if user_person:
 return b'"' + user_person + b'" <' + user_email + b'>'



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


Proposed PEP on Python C API

2020-04-10 Thread Gregory Szorc
https://mail.python.org/archives/list/python-...@python.org/thread/HKM774XKU7DPJNLUTYHUB5U6VR6EQMJF/

This is very relevant to Mercurial’s interests, since some of the changes might 
adversely affect Mercurial performance, as we rely on various internal APIs not 
part of the stable ABI.___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8397: tests: deal with "ls" vs "ls -A" difference on 2BSD derived systems

2020-04-10 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  BSD-derived systems will use "ls -A" when running as root. Adjust the
  test cases to always use the flag and include .hg and related output as
  appropiately.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-audit-subrepo.t
  tests/test-backwards-remove.t
  tests/test-clone.t
  tests/test-copytrace-heuristics.t
  tests/test-fetch.t
  tests/test-import.t
  tests/test-largefiles.t
  tests/test-narrow-acl.t
  tests/test-narrow-clone-stream.t
  tests/test-narrow-clone.t
  tests/test-narrow-pull.t
  tests/test-narrow-trackedcmd.t
  tests/test-narrow-widen-no-ellipsis.t
  tests/test-narrow-widen.t
  tests/test-purge.t
  tests/test-remotefilelog-local.t
  tests/test-revert-interactive.t
  tests/test-revert-unknown.t
  tests/test-revert.t
  tests/test-shelve.t
  tests/test-sparse-clear.t
  tests/test-sparse-clone.t
  tests/test-sparse-import.t
  tests/test-sparse-merges.t
  tests/test-sparse-profiles.t
  tests/test-sparse-requirement.t
  tests/test-sparse.t
  tests/test-subrepo-missing.t
  tests/test-subrepo.t
  tests/test-uncommit.t
  tests/test-update-reverse.t

CHANGE DETAILS

diff --git a/tests/test-update-reverse.t b/tests/test-update-reverse.t
--- a/tests/test-update-reverse.t
+++ b/tests/test-update-reverse.t
@@ -12,7 +12,8 @@
 
 'main' should be gone:
 
-  $ ls
+  $ ls -A
+  .hg
   a
 
   $ touch side1
@@ -59,7 +60,8 @@
   date:Thu Jan 01 00:00:00 1970 +
   summary: Added main
   
-  $ ls
+  $ ls -A
+  .hg
   a
   side1
   side2
@@ -76,7 +78,8 @@
   getting main
   1 files updated, 0 files merged, 2 files removed, 0 files unresolved
 
-  $ ls
+  $ ls -A
+  .hg
   a
   main
 
diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -60,7 +60,8 @@
   $ touch files
   $ hg add files
   $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg 
add file-$i; hg commit -m "added file-$i"; done
-  $ ls
+  $ ls -A
+  .hg
   file-a
   file-ab
   file-abc
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -498,7 +498,10 @@
   abort: subrepos not enabled
   (see 'hg help config.subrepos' for details)
   [255]
-  $ ls tc2
+  $ ls -A tc2
+  .hg
+  .hgsub
+  .hgsubstate
   a
 
   $ hg clone t tc3 --config subrepos.allowed=false
@@ -506,7 +509,10 @@
   abort: subrepos not enabled
   (see 'hg help config.subrepos' for details)
   [255]
-  $ ls tc3
+  $ ls -A tc3
+  .hg
+  .hgsub
+  .hgsubstate
   a
 
 And again with just the hg type disabled
@@ -516,7 +522,10 @@
   abort: hg subrepos not allowed
   (see 'hg help config.subrepos' for details)
   [255]
-  $ ls tc4
+  $ ls -A tc4
+  .hg
+  .hgsub
+  .hgsubstate
   a
 
   $ hg clone t tc5 --config subrepos.hg:allowed=false
@@ -524,7 +533,10 @@
   abort: hg subrepos not allowed
   (see 'hg help config.subrepos' for details)
   [255]
-  $ ls tc5
+  $ ls -A tc5
+  .hg
+  .hgsub
+  .hgsubstate
   a
 
 push
diff --git a/tests/test-subrepo-missing.t b/tests/test-subrepo-missing.t
--- a/tests/test-subrepo-missing.t
+++ b/tests/test-subrepo-missing.t
@@ -50,7 +50,8 @@
   $ hg st
   warning: subrepo spec file '.hgsub' not found
   ! .hgsub
-  $ ls subrepo
+  $ ls -A subrepo
+  .hg
   a
 
 delete .hgsubstate and update
@@ -65,7 +66,8 @@
   use (c)hanged version or leave (d)eleted? c
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg st
-  $ ls subrepo
+  $ ls -A subrepo
+  .hg
   a
 
 Enable obsolete
@@ -134,7 +136,10 @@
   1: repository $TESTTMP/repo/subrepo not found
   3: repository $TESTTMP/repo/subrepo not found
   4: repository $TESTTMP/repo/subrepo not found
-  $ ls
+  $ ls -A
+  .hg
+  .hgsub
+  .hgsubstate
   b
   $ mv b subrepo
 
diff --git a/tests/test-sparse.t b/tests/test-sparse.t
--- a/tests/test-sparse.t
+++ b/tests/test-sparse.t
@@ -22,7 +22,8 @@
 
   $ hg up -q 0
   $ hg debugsparse --include 'hide'
-  $ ls
+  $ ls -A
+  .hg
   hide
 
 Absolute paths outside the repo should just be rejected
@@ -77,7 +78,8 @@
 
   $ echo z > hide
   $ hg ci -Aqm 'edit hide'
-  $ ls
+  $ ls -A
+  .hg
   hide
   $ hg manifest
   hide
@@ -86,7 +88,8 @@
 Verify --reset brings files back
 
   $ hg debugsparse --reset
-  $ ls
+  $ ls -A
+  .hg
   hide
   show
   $ cat hide
@@ -106,11 +109,13 @@
 Verify update only writes included files
 
   $ hg up -q 0
-  $ ls
+  $ ls -A
+  .hg
   show
 
   $ hg up -q 1
-  $ ls
+  $ ls -A
+  .hg
   show
   show2
 
@@ -144,7 +149,8 @@
 
   $ hg debugsparse --delete -f 'show*'
   pending changes to 'hide'
-  $ ls
+  $ ls -A
+  .hg
   hide
   hide2
   hide3
@@ -166,7 +172,8 @@
 
   $ hg debugsparse --exclude -f 'hide*'
   pending changes to 'hide'
-  $ ls
+  $ ls -A
+  .hg
   hide
   hide3
   show
@@ -177,7 +184,8 @@
   $ 

D8395: tests: skip CVS tests for root

2020-04-10 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It is not uncommon for cvs to check for root and to refuse work
  in that case.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-convert-cvs-branch.t
  tests/test-convert-cvs-detectmerge.t
  tests/test-convert-cvs-synthetic.t
  tests/test-convert-cvs.t
  tests/test-convert-cvsnt-mergepoints.t

CHANGE DETAILS

diff --git a/tests/test-convert-cvsnt-mergepoints.t 
b/tests/test-convert-cvsnt-mergepoints.t
--- a/tests/test-convert-cvsnt-mergepoints.t
+++ b/tests/test-convert-cvsnt-mergepoints.t
@@ -1,4 +1,4 @@
-#require cvs
+#require cvs no-root
 
   $ filterpath()
   > {
diff --git a/tests/test-convert-cvs.t b/tests/test-convert-cvs.t
--- a/tests/test-convert-cvs.t
+++ b/tests/test-convert-cvs.t
@@ -1,4 +1,4 @@
-#require cvs
+#require cvs no-root
 
   $ cvscall()
   > {
diff --git a/tests/test-convert-cvs-synthetic.t 
b/tests/test-convert-cvs-synthetic.t
--- a/tests/test-convert-cvs-synthetic.t
+++ b/tests/test-convert-cvs-synthetic.t
@@ -1,4 +1,4 @@
-#require cvs112
+#require cvs112 no-root
 
 This feature requires use of builtin cvsps!
 
diff --git a/tests/test-convert-cvs-detectmerge.t 
b/tests/test-convert-cvs-detectmerge.t
--- a/tests/test-convert-cvs-detectmerge.t
+++ b/tests/test-convert-cvs-detectmerge.t
@@ -1,4 +1,4 @@
-#require cvs
+#require cvs no-root
 
 Test config convert.cvsps.mergefrom config setting.
 (Should test similar mergeto feature, but I don't understand it yet.)
diff --git a/tests/test-convert-cvs-branch.t b/tests/test-convert-cvs-branch.t
--- a/tests/test-convert-cvs-branch.t
+++ b/tests/test-convert-cvs-branch.t
@@ -1,4 +1,4 @@
-#require cvs
+#require cvs no-root
 
 This is https://bz.mercurial-scm.org/1148
 and https://bz.mercurial-scm.org/1447



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


D8396: tests: skip non-readable check for root

2020-04-10 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Trying to check for errors on non-readable hgrc requires UNIX
  permissions, but still won't work for root. So adjust the check.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-hgrc.t

CHANGE DETAILS

diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t
--- a/tests/test-hgrc.t
+++ b/tests/test-hgrc.t
@@ -56,7 +56,7 @@
   $ echo '%include $TESTTMP/included' >> $HGRC
   $ hg showconfig section
   section.option=value
-#if no-windows
+#if unix-permissions no-root
   $ chmod u-r $TESTTMP/included
   $ hg showconfig section
   hg: parse error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included 
(Permission denied)



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


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-10 Thread marmoute (Pierre-Yves David)
marmoute added a comment.
marmoute abandoned this revision.


  superseeded by D8392 

REPOSITORY
  rHG Mercurial

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

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

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


D8244: copies: fix the changeset based algorithm regarding merge

2020-04-10 Thread marmoute (Pierre-Yves David)
marmoute updated this revision to Diff 21029.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8244?vs=20596=21029

BRANCH
  default

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

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

AFFECTED FILES
  mercurial/copies.py
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -1,3 +1,5 @@
+#testcases filelog compatibility sidedata
+
 =
 Test Copy tracing for chain of copies involving merge
 =
@@ -6,6 +8,7 @@
 are involved. It cheks we do not have unwanted update of behavior and that the
 different options to retrieve copies behave correctly.
 
+
 Setup
 =
 
@@ -18,6 +21,22 @@
   > logtemplate={rev} {desc}\n
   > EOF
 
+#if compatibility
+  $ cat >> $HGRCPATH << EOF
+  > [experimental]
+  > copies.read-from = compatibility
+  > EOF
+#endif
+
+#if sidedata
+  $ cat >> $HGRCPATH << EOF
+  > [format]
+  > exp-use-side-data = yes
+  > exp-use-copies-side-data-changeset = yes
+  > EOF
+#endif
+
+
   $ hg init repo-chain
   $ cd repo-chain
 
@@ -453,17 +472,26 @@
0   4 0dd616bc7ab1  
1  10 6da5a2eecb9c  
2  19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c
+
+# Here the filelog based implementation is not looking at the rename
+# information (because the file exist on both side). However the changelog
+# based on works fine. We have different output.
+
   $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
   M f
+b (no-filelog !)
   R b
   $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
   M f
+b (no-filelog !)
   R b
   $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
   M f
+d (no-filelog !)
   R d
   $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
   M f
+d (no-filelog !)
   R d
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
   A f
@@ -473,6 +501,18 @@
   A f
 b
   R b
+
+# From here, we run status against revision where both source file exists.
+#
+# The filelog based implementation picks an arbitrary side based on revision
+# numbers. So the same side "wins" whatever the parents order is. This is
+# sub-optimal because depending on revision numbers means the result can be
+# different from one repository to the next.
+#
+# The changeset based algorithm use the parent order to break tie on 
conflicting
+# information and will have a different order depending on who is p1 and p2.
+# That order is stable accross repositories. (data from p1 prevails)
+
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
   A f
 d
@@ -480,7 +520,8 @@
   R d
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
   A f
-d
+d (filelog !)
+b (no-filelog !)
   R b
   R d
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
@@ -490,7 +531,8 @@
   R b
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
   A f
-a
+a (filelog !)
+b (no-filelog !)
   R a
   R b
 
@@ -563,21 +605,25 @@
   R h
   $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
   M d
+h (no-filelog !)
   R h
   $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
   M b
   $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
   M b
   M d
+i (no-filelog !)
   R i
   $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
   M d
+h (no-filelog !)
   R h
   $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
   M b
   $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
   M b
   M d
+i (no-filelog !)
   R i
 
 The following graphlog is wrong, the "a -> c -> d" chain was overwritten and 
should not appear.
@@ -645,9 +691,15 @@
   |
   o  0 i-0 initial commit: a b h
   
+One side of the merge have a long history with rename. The other side of the
+merge point to a new file with a smaller history. Each side is "valid".
+
+(and again the filelog based algorithm only explore one, with a pick based on
+revision numbers)
+
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
   A d
-a
+a (filelog !)
   R a
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
   A d
@@ -740,7 +792,8 @@
   
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
   A d
-a
+h (no-filelog !)
+a (filelog !)
   R a
   R h
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
@@ -754,15 +807,19 @@
   M d
   $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
   M d
+i (no-filelog !)
   R i
   $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
   M d
+i (no-filelog !)
   R i
   $ hg status 

D8394: revset: implement a simple 'foo#generations' expression

2020-04-10 Thread av6 (Anton Shestakov)
av6 created this revision.
av6 added a reviewer: yuja.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The result of this expression is equivalent to 'foo#g[:]': all reachable
  ancestors and descendants of a revset foo.
  
  While not very useful functionality on its own, its implementation can be
  tested and revset.relations dict can be easily used by extensions to add other
  non-subscript relations.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revset.py
  tests/test-revset.t

CHANGE DETAILS

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -1274,6 +1274,36 @@
   5
   7
 
+test ancestors/descendants relation:
+
+  $ log 'tip#generations'
+  0
+  1
+  2
+  4
+  8
+  9
+
+  $ log '3#g'
+  0
+  1
+  3
+  5
+  6
+  7
+
+  $ hg debugrevspec -p parsed 'tip#g'
+  * parsed:
+  (relation
+(symbol 'tip')
+(symbol 'g'))
+  0
+  1
+  2
+  4
+  8
+  9
+
 test ancestors/descendants relation subscript:
 
   $ log 'tip#generations[0]'
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -247,7 +247,15 @@
 
 
 def relationset(repo, subset, x, y, order):
-raise error.ParseError(_(b"can't use a relation in this context"))
+# this is pretty basic implementation of 'x#y' operator, still
+# experimental so undocumented. see the wiki for further ideas.
+# https://www.mercurial-scm.org/wiki/RevsetOperatorPlan
+rel = getsymbol(y)
+if rel in relations:
+return relations[rel](repo, subset, x, rel, order)
+
+relnames = [r for r in relations.keys() if len(r) > 1]
+raise error.UnknownIdentifier(rel, relnames)
 
 
 def _splitrange(a, b):
@@ -281,6 +289,11 @@
 return ancdepths, descdepths
 
 
+def generationsrel(repo, subset, x, rel, order):
+z = (b'rangeall', None)
+return generationssubrel(repo, subset, x, rel, z, order)
+
+
 def generationssubrel(repo, subset, x, rel, z, order):
 # TODO: rewrite tests, and drop startdepth argument from ancestors() and
 # descendants() predicates
@@ -2633,6 +2646,11 @@
 b"smartset": rawsmartset,
 }
 
+relations = {
+b"g": generationsrel,
+b"generations": generationsrel,
+}
+
 subscriptrelations = {
 b"g": generationssubrel,
 b"generations": generationssubrel,



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


D8393: revset: rename generationsrel() to generationssubrel()

2020-04-10 Thread av6 (Anton Shestakov)
av6 created this revision.
av6 added a reviewer: yuja.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This highlights that this is an implementation of 'x#y[z]' relation subscript
  operator as opposed to 'x#y' relation operator.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -281,7 +281,7 @@
 return ancdepths, descdepths
 
 
-def generationsrel(repo, subset, x, rel, z, order):
+def generationssubrel(repo, subset, x, rel, z, order):
 # TODO: rewrite tests, and drop startdepth argument from ancestors() and
 # descendants() predicates
 a, b = getintrange(
@@ -2634,8 +2634,8 @@
 }
 
 subscriptrelations = {
-b"g": generationsrel,
-b"generations": generationsrel,
+b"g": generationssubrel,
+b"generations": generationssubrel,
 }
 
 



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


D8392: [RFC] mergestate: store about files resolved in favour of other

2020-04-10 Thread pulkit (Pulkit Goyal)
Closed by commit rHG1b8fd4af3318: mergestate: store about files resolved in 
favour of other (authored by pulkit).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8392?vs=21024=21026

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

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/localrepo.py
  mercurial/merge.py
  tests/test-convert-hg-source.t
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -319,7 +319,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBDm-0 simple merge - one way'
   $ hg up 'desc("d-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -348,7 +348,6 @@
   M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
   M b
-  M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
   M b
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
@@ -361,7 +360,7 @@
 The bugs makes recorded copy is different depending of where we started the 
merge from since
 
   $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644   d'
-  0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644   d
+  b004912a8510032a0350a74daa2803dadfb00e12 644   d
   $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644   d'
   b004912a8510032a0350a74daa2803dadfb00e12 644   d
 
@@ -378,21 +377,13 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1   8 b004912a8510  
-   2  17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
 
 (This `hg log` output if wrong, since no merge actually happened).
 
   $ hg log -Gfr 'desc("mBDm-0")' d
-  o17 mBDm-0 simple merge - one way
-  |\
-  o :  8 d-2 re-add d
-  :/
-  o  2 i-2: c -move-> d
+  o  8 d-2 re-add d
   |
-  o  1 i-1: a -move-> c
-  |
-  o  0 i-0 initial commit: a b h
-  
+  ~
 
 This `hg log` output is correct
 
@@ -404,7 +395,6 @@
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
   M b
   A d
-a
   R a
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
   M b
@@ -525,8 +515,7 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1   8 b004912a8510  
-   2  17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
-   3  22 c72365ee036f  
+   2  22 c72365ee036f  
   $ hg up 'desc("b-1")'
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("f-2")'
@@ -534,7 +523,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBFm-0 simple merge - one way'
   $ hg up 'desc("f-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -562,7 +551,7 @@
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
   M b
   A d
-a (true !)
+h
 h (false !)
   R a
   R h
@@ -577,7 +566,6 @@
   R h
   $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
   M b
-  M d
   $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
   M b
   M d
@@ -595,16 +583,10 @@
 The following graphlog is wrong, the "a -> c -> d" chain was overwritten and 
should not appear.
 
   $ hg log -Gfr 'desc("mBFm-0")' d
-  o23 mBFm-0 simple merge - one way
-  |\
-  o :  22 f-2: rename i -> d
-  | :
-  o :  21 f-1: rename h -> i
-  :/
-  o  2 i-2: c -move-> d
+  o  22 f-2: rename i -> d
   |
-  o  1 i-1: a -move-> c
-  |
+  o  21 f-1: rename h -> i
+  :
   o  0 i-0 initial commit: a b h
   
 
diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t
--- a/tests/test-convert-hg-source.t
+++ b/tests/test-convert-hg-source.t
@@ -62,9 +62,9 @@
   6 make bar and baz copies of foo
   5 merge local copy
   4 merge remote copy
-  3 Added tag that for changeset 88586c4e9f02
+  3 Added tag that for changeset 8601262d7472
   2 Removed tag that
-  1 Added tag this for changeset c56a7f387039
+  1 Added tag this for changeset 706614b458c1
   0 mark baz executable
   updating bookmarks
   $ cd new
@@ -76,7 +76,7 @@
 #if execbit
   $ hg bookmarks
  premerge1 3:973ef48a98a4
- premerge2 8:91d107c423ba
+ premerge2 8:c4968fdf2e5d
 #else
 

D8392: [RFC] mergestate: store about files resolved in favour of other

2020-04-10 Thread durin42 (Augie Fackler)
durin42 added a comment.
durin42 accepted this revision as: durin42.
durin42 added subscribers: martinvonz, durin42.


  I like it, but want to get @martinvonz to look too.

REPOSITORY
  rHG Mercurial

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

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

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


D8391: histedit: add test that an invalid editor doesn't bork client state

2020-04-10 Thread durin42 (Augie Fackler)
Closed by commit rHGbca57ad9e630: histedit: add test that an invalid editor 
doesnt bork client state (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8391?vs=21023=21025

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

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

AFFECTED FILES
  tests/test-histedit-non-commute.t

CHANGE DETAILS

diff --git a/tests/test-histedit-non-commute.t 
b/tests/test-histedit-non-commute.t
--- a/tests/test-histedit-non-commute.t
+++ b/tests/test-histedit-non-commute.t
@@ -300,4 +300,7 @@
  summary: Initial commit
   
 
+An invalid editor shouldn't leave the user in a broken state:
+  $ EDITOR=totally-not-a-thing-unsensible-editor-value hg histedit 4
+
   $ cd ..



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


D8392: [RFC] mergestate: store about files resolved in favour of other

2020-04-10 Thread marmoute (Pierre-Yves David)
marmoute added a comment.
marmoute accepted this revision.


  The approach seems good and the test change seems consistent with D8243 
 (@pulkit can you confirm there are no 
difference?)
  
  This looks good to me.

REPOSITORY
  rHG Mercurial

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

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

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


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-10 Thread marmoute (Pierre-Yves David)
marmoute added a comment.


  In D8243#125293 , @pulkit wrote:
  
  > D8392  is an attempt to fix the same 
issue by storing extra information in mergestate.
  
  The approach (storing in the merge state) is the one I planned to implement 
before handling the task to Pulkit. so +1 on the approach.
  
  (feel free to reuse that very same diff for it.)

REPOSITORY
  rHG Mercurial

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

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

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


D8392: [RFC] mergestate: store about files resolved in favour of other

2020-04-10 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  This attempts to fix the issue which D8243 
 tries to fix by storing extra 
information in mergestate.

REPOSITORY
  rHG Mercurial

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

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

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


D8243: copies: stop recording buggy file merge when new file overwrite an old one

2020-04-10 Thread pulkit (Pulkit Goyal)
pulkit added a comment.


  D8392  is an attempt to fix the same 
issue by storing extra information in mergestate.

REPOSITORY
  rHG Mercurial

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

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

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


D8392: [RFC] mergestate: store about files resolved in favour of other

2020-04-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This starts storing information in mergestate about files which were
  automatically merged and the other/remote version of file was used.
  We need this information at commit to pick the filenode parent for the new
  commit. The commit code has weird filenode resolution here which does not 
depend
  on what merge did and rely on some file ancestry logic. That leads to problem 
in
  some cases, the tests which are changed by this patch.
  
  Somethings which can be further investigated are:
  
  1. refactoring of commit logic more to depend on this information
  2. maybe a more generic solution?

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py
  mercurial/localrepo.py
  mercurial/merge.py
  tests/test-convert-hg-source.t
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -319,7 +319,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBDm-0 simple merge - one way'
   $ hg up 'desc("d-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -348,7 +348,6 @@
   M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
   M b
-  M d
   $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
   M b
   $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
@@ -361,7 +360,7 @@
 The bugs makes recorded copy is different depending of where we started the 
merge from since
 
   $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644   d'
-  0bb5445dc4d02f4e0d86cf16f9f3a411d0f17744 644   d
+  b004912a8510032a0350a74daa2803dadfb00e12 644   d
   $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644   d'
   b004912a8510032a0350a74daa2803dadfb00e12 644   d
 
@@ -378,21 +377,13 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1   8 b004912a8510  
-   2  17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
 
 (This `hg log` output if wrong, since no merge actually happened).
 
   $ hg log -Gfr 'desc("mBDm-0")' d
-  o17 mBDm-0 simple merge - one way
-  |\
-  o :  8 d-2 re-add d
-  :/
-  o  2 i-2: c -move-> d
+  o  8 d-2 re-add d
   |
-  o  1 i-1: a -move-> c
-  |
-  o  0 i-0 initial commit: a b h
-  
+  ~
 
 This `hg log` output is correct
 
@@ -404,7 +395,6 @@
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
   M b
   A d
-a
   R a
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
   M b
@@ -525,8 +515,7 @@
  rev linkrev nodeid   p1   p2
0   2 01c2f5eabdc4  
1   8 b004912a8510  
-   2  17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510
-   3  22 c72365ee036f  
+   2  22 c72365ee036f  
   $ hg up 'desc("b-1")'
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("f-2")'
@@ -534,7 +523,7 @@
   (branch merge, don't forget to commit)
   $ hg ci -m 'mBFm-0 simple merge - one way'
   $ hg up 'desc("f-2")'
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 'desc("b-1")'
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -562,7 +551,7 @@
   $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
   M b
   A d
-a (true !)
+h
 h (false !)
   R a
   R h
@@ -577,7 +566,6 @@
   R h
   $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
   M b
-  M d
   $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
   M b
   M d
@@ -595,16 +583,10 @@
 The following graphlog is wrong, the "a -> c -> d" chain was overwritten and 
should not appear.
 
   $ hg log -Gfr 'desc("mBFm-0")' d
-  o23 mBFm-0 simple merge - one way
-  |\
-  o :  22 f-2: rename i -> d
-  | :
-  o :  21 f-1: rename h -> i
-  :/
-  o  2 i-2: c -move-> d
+  o  22 f-2: rename i -> d
   |
-  o  1 i-1: a -move-> c
-  |
+  o  21 f-1: rename h -> i
+  :
   o  0 i-0 initial commit: a b h
   
 
diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t
--- a/tests/test-convert-hg-source.t
+++ b/tests/test-convert-hg-source.t
@@ -62,9 +62,9 @@
   6 make bar and baz copies of foo
   5 merge local copy
   4 merge remote copy
-  3 Added tag that for changeset 88586c4e9f02
+  3 Added