D8786: templater: make templatepaths() return a single path, or None

2020-07-21 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/debugcommands.py
  mercurial/hgweb/hgwebdir_mod.py
  mercurial/hgweb/webcommands.py
  mercurial/templater.py

CHANGE DETAILS

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -800,10 +800,10 @@
 
 
 def stylelist():
-paths = templatepaths()
-if not paths:
+path = templatedir()
+if not path:
 return _(b'no templates found, try `hg debuginstall` for more info')
-dirlist = os.listdir(paths[0])
+dirlist = os.listdir(path)
 stylelist = []
 for file in dirlist:
 split = file.split(b".")
@@ -823,7 +823,7 @@
 )
 
 base = os.path.dirname(mapfile)
-conf = config.config(includepaths=templatepaths())
+conf = config.config(includepaths=[templatedir()])
 conf.read(mapfile, remap={b'': b'templates'})
 
 cache = {}
@@ -837,15 +837,13 @@
 
 # fallback check in template paths
 if not os.path.exists(path):
-for p in templatepaths():
-p2 = util.normpath(os.path.join(p, val))
-if os.path.isfile(p2):
-path = p2
-break
+p2 = util.normpath(os.path.join(templatedir(), val))
+if os.path.isfile(p2):
+path = p2
+else:
 p3 = util.normpath(os.path.join(p2, b"map"))
 if os.path.isfile(p3):
 path = p3
-break
 
 cache, tmap, aliases = _readmapfile(path)
 
@@ -1045,18 +1043,17 @@
 return stream
 
 
-def templatepaths():
-'''return locations used for template files.'''
+def templatedir():
+'''return the directory used for template files, or None.'''
 path = os.path.normpath(os.path.join(resourceutil.datapath, b'templates'))
-return [path] if os.path.isdir(path) else []
+return path if os.path.isdir(path) else None
 
 
 def templatepath(name):
 '''return location of template file. returns None if not found.'''
-for p in templatepaths():
-f = os.path.join(p, name)
-if os.path.exists(f):
-return f
+f = os.path.join(templatedir(), name)
+if f and os.path.exists(f):
+return f
 return None
 
 
@@ -1070,7 +1067,7 @@
 """
 
 if paths is None:
-paths = templatepaths()
+paths = [templatedir()]
 elif isinstance(paths, bytes):
 paths = [paths]
 
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1319,7 +1319,7 @@
 # readable by the user running the CGI script
 static = web.config(b"web", b"static", untrusted=False)
 if not static:
-tp = web.templatepath or templater.templatepaths()
+tp = web.templatepath or templater.templatedir()
 if isinstance(tp, bytes):
 tp = [tp]
 static = [os.path.join(p, b'static') for p in tp]
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -414,7 +414,7 @@
 fname = req.qsparams[b'static']
 static = self.ui.config(b"web", b"static", untrusted=False)
 if not static:
-tp = self.templatepath or templater.templatepaths()
+tp = self.templatepath or templater.templatedir()
 if isinstance(tp, bytes):
 tp = [tp]
 static = [os.path.join(p, b'static') for p in tp]
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1668,8 +1668,8 @@
 fm.data(re2=bool(util._re2))
 
 # templates
-p = templater.templatepaths()
-fm.write(b'templatedirs', b'checking templates (%s)...\n', b' '.join(p))
+p = templater.templatedir()
+fm.write(b'templatedirs', b'checking templates (%s)...\n', p)
 fm.condwrite(not p, b'', _(b" no template directories found\n"))
 if p:
 m = templater.templatepath(b"map-cmdline.default")



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


D8788: hgweb: simplify now that we always have a single path

2020-07-21 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Both `templatedir()` and `web.templatepath` are now always a single
  path (or None).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/hgweb/hgwebdir_mod.py
  mercurial/hgweb/webcommands.py

CHANGE DETAILS

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1320,9 +1320,7 @@
 static = web.config(b"web", b"static", untrusted=False)
 if not static:
 tp = web.templatepath or templater.templatedir()
-if isinstance(tp, bytes):
-tp = [tp]
-static = [os.path.join(p, b'static') for p in tp]
+static = [os.path.join(tp, b'static')]
 
 staticfile(static, fname, web.res)
 return web.res.sendresponse()
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -415,9 +415,7 @@
 static = self.ui.config(b"web", b"static", untrusted=False)
 if not static:
 tp = self.templatepath or templater.templatedir()
-if isinstance(tp, bytes):
-tp = [tp]
-static = [os.path.join(p, b'static') for p in tp]
+static = [os.path.join(tp, b'static')]
 
 staticfile(static, fname, res)
 return res.sendresponse()



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


D8787: templater: simplify stylemap() now that templatedir() returns a single path

2020-07-21 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/templater.py

CHANGE DETAILS

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1057,7 +1057,7 @@
 return None
 
 
-def stylemap(styles, paths=None):
+def stylemap(styles, path=None):
 """Return path to mapfile for a given style.
 
 Searches mapfile in the following locations:
@@ -1066,10 +1066,8 @@
 3. templatepath/map
 """
 
-if paths is None:
-paths = [templatedir()]
-elif isinstance(paths, bytes):
-paths = [paths]
+if path is None:
+path = templatedir()
 
 if isinstance(styles, bytes):
 styles = [styles]
@@ -1087,10 +1085,9 @@
 locations = [os.path.join(style, b'map'), b'map-' + style]
 locations.append(b'map')
 
-for path in paths:
-for location in locations:
-mapfile = os.path.join(path, location)
-if os.path.isfile(mapfile):
-return style, mapfile
+for location in locations:
+mapfile = os.path.join(path, location)
+if os.path.isfile(mapfile):
+return style, mapfile
 
-raise RuntimeError(b"No hgweb templates found in %r" % paths)
+raise RuntimeError(b"No hgweb templates found in %r" % path)



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


D8785: templater: simplify templatepaths() to avoid iterating a singleton list

2020-07-21 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The function iterates over a hard-coded list of one element since
  d844e220792a 
 
(templater: don't search randomly for templates - trust
  util.datapath, 2014-09-28).

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/templater.py

CHANGE DETAILS

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1047,12 +1047,8 @@
 
 def templatepaths():
 '''return locations used for template files.'''
-pathsrel = [b'templates']
-paths = [
-os.path.normpath(os.path.join(resourceutil.datapath, f))
-for f in pathsrel
-]
-return [p for p in paths if os.path.isdir(p)]
+path = os.path.normpath(os.path.join(resourceutil.datapath, b'templates'))
+return [path] if os.path.isdir(path) else []
 
 
 def templatepath(name):



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


[Bug 6382] New: Ctrl-c at the "wrong" time can cause corrupted evolvestate file

2020-07-21 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6382

Bug ID: 6382
   Summary: Ctrl-c at the "wrong" time can cause corrupted
evolvestate file
   Product: Mercurial
   Version: unspecified
  Hardware: PC
OS: Mac OS
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: h...@pewpew.net
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org
Python Version: ---

Created attachment 2083
  --> https://bz.mercurial-scm.org/attachment.cgi?id=2083&action=edit
patch for test-evolve-interrupted.t to demonstrate issue

If a user hits ctrl-c at just the wrong time, `hg evolve` may leave behind a
.hg/evolvestate file that references a node that was not created. I do not
believe that this requires using rebase.experimental.inmemory, please see the
attached patch adding a test that passes if it hits the *bad* case.

To recover from this, we've been telling users to run `rm .hg/evolvestate; hg
update --clean .`

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8784: tags: adjust file node cache to have space for 32 bytes node ids

2020-07-21 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The .hgtags processing uses two different caches. The first cache is
  essentially a global version of all .hgtags files and a textual format
  without hard size requirements. The second cache stores the file node of
  the .hgtags file for those changesets that modify it as fixed size
  records. Use a new file name for this record and pad the entries to 32
  bytes in preparation for replacing SHA1.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cacheutil.py
  mercurial/debugcommands.py
  mercurial/tags.py
  tests/test-cache-abuse.t
  tests/test-debugcommands.t
  tests/test-help.t
  tests/test-server-view.t
  tests/test-static-http.t
  tests/test-tags.t

CHANGE DETAILS

diff --git a/tests/test-tags.t b/tests/test-tags.t
--- a/tests/test-tags.t
+++ b/tests/test-tags.t
@@ -15,7 +15,7 @@
   > }
 
   $ fnodescacheexists() {
-  >   [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no 
fnodes cache"
+  >   [ -f .hg/cache/hgtagsfnodes2 ] && echo "fnodes cache exists" || echo "no 
fnodes cache"
   > }
 
   $ dumptags() {
@@ -98,34 +98,38 @@
 
   $ fnodescacheexists
   fnodes cache exists
-  $ f --size --hexdump .hg/cache/hgtagsfnodes1
-  .hg/cache/hgtagsfnodes1: size=48
+  $ f --size --hexdump .hg/cache/hgtagsfnodes2
+  .hg/cache/hgtagsfnodes2: size=72
   : ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ||
-  0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..F6&...|
-  0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s/Q...^..f.Y|
+  0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ||
+  0020: ff ff ff ff b9 15 46 36 26 b7 b4 a7 73 e0 9e e3 |..F6&...s...|
+  0030: c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 00 00 00 00 |./Q...^..f.Y|
+  0040: 00 00 00 00 00 00 00 00 ||
   $ hg debugtagscache
   0 acb14030fe0a21b60322c440ad2d20cf7685a376 missing/invalid
   1 b9154636be938d3d431e75a7c906504a079bfe07 
26b7b4a773e09ee3c52f510e19e05e1ff966d859
 
 Repeat with cold tag cache:
 
-  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
+  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes2
   $ hg identify
   b9154636be93 tip
 
   $ fnodescacheexists
   fnodes cache exists
-  $ f --size --hexdump .hg/cache/hgtagsfnodes1
-  .hg/cache/hgtagsfnodes1: size=48
+  $ f --size --hexdump .hg/cache/hgtagsfnodes2
+  .hg/cache/hgtagsfnodes2: size=72
   : ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ||
-  0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..F6&...|
-  0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s/Q...^..f.Y|
+  0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ||
+  0020: ff ff ff ff b9 15 46 36 26 b7 b4 a7 73 e0 9e e3 |..F6&...s...|
+  0030: c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 00 00 00 00 |./Q...^..f.Y|
+  0040: 00 00 00 00 00 00 00 00 ||
 
 And again, but now unable to write tag cache or lock file:
 
 #if unix-permissions no-fsmonitor
 
-  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
+  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes2
   $ chmod 555 .hg/cache
   $ hg identify
   b9154636be93 tip
@@ -142,12 +146,12 @@
 
 Tag cache debug info written to blackbox log
 
-  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
+  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes2
   $ hg identify
   b9154636be93 tip
   $ hg blackbox -l 6
   1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
identify
-  1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
writing 48 bytes to cache/hgtagsfnodes1
+  1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
writing 72 bytes to cache/hgtagsfnodes2
   1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
0/2 cache hits/lookups in * seconds (glob)
   1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
writing .hg/cache/tags2-visible with 1 tags
   1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
identify exited 0 after * seconds (glob)
@@ -155,13 +159,13 @@
 
 Failure to acquire lock results in no write
 
-  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
+  $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes2
   $ echo 'foo:1' > .hg/wlock
   $ hg identify
   b9154636be93 tip
   $ hg blackbox -l 6
   1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
identify
-  1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired
+  1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 
not writing .hg/cache/hgtagsfnodes2 because lock cannot 

D8783: storageutil: allow modern hash sizes for fileids

2020-07-21 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/utils/storageutil.py

CHANGE DETAILS

diff --git a/mercurial/utils/storageutil.py b/mercurial/utils/storageutil.py
--- a/mercurial/utils/storageutil.py
+++ b/mercurial/utils/storageutil.py
@@ -180,9 +180,9 @@
 
 ``fileid`` can be:
 
-* A 20 byte binary node.
+* A 20 or 32 byte binary node.
 * An integer revision number
-* A 40 byte hex node.
+* A 40 or 64 byte hex node.
 * A bytes that can be parsed as an integer representing a revision number.
 
 ``identifier`` is used to populate ``error.LookupError`` with an identifier
@@ -198,14 +198,14 @@
 b'%d' % fileid, identifier, _(b'no match found')
 )
 
-if len(fileid) == 20:
+if len(fileid) in (20, 32):
 try:
 store.rev(fileid)
 return fileid
 except error.LookupError:
 pass
 
-if len(fileid) == 40:
+if len(fileid) in (40, 64):
 try:
 rawnode = bin(fileid)
 store.rev(rawnode)



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


D8782: tests: make flag parsing test more future safe

2020-07-21 Thread joerg.sonnenberger (Joerg Sonnenberger)
joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The revlog format contains a number of feature flags, e.g. if general
  deltas are active. When testing that unknown flags are rejected, use
  bits that are not immediately following the currently used bits.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-revlog-v2.t

CHANGE DETAILS

diff --git a/tests/test-revlog-v2.t b/tests/test-revlog-v2.t
--- a/tests/test-revlog-v2.t
+++ b/tests/test-revlog-v2.t
@@ -32,10 +32,10 @@
 Unknown flags to revlog are rejected
 
   >>> with open('.hg/store/00changelog.i', 'wb') as fh:
-  ... fh.write(b'\x00\x04\xde\xad') and None
+  ... fh.write(b'\xff\x00\xde\xad') and None
 
   $ hg log
-  abort: unknown flags (0x04) in version 57005 revlog 00changelog.i!
+  abort: unknown flags (0xff00) in version 57005 revlog 00changelog.i!
   [255]
 
   $ cd ..



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


mercurial@45185: 13 new changesets (5 on stable)

2020-07-21 Thread Mercurial Commits
13 new changesets (5 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/2bc5d1531235
changeset:   45173:2bc5d1531235
user:Yuya Nishihara 
date:Sun Jul 19 17:24:16 2020 +0900
summary: revlog: fix excessive decref on tuple creation failure in 
parse_index2()

https://www.mercurial-scm.org/repo/hg/rev/f93a4e3d35ab
changeset:   45174:f93a4e3d35ab
user:Yuya Nishihara 
date:Sun Jul 19 17:35:41 2020 +0900
summary: osutil: fix excessive decref on tuple creation failure in listdir()

https://www.mercurial-scm.org/repo/hg/rev/211063648b29
changeset:   45175:211063648b29
user:Yuya Nishihara 
date:Sat Jul 18 18:13:41 2020 +0900
summary: phases: fix error return with no exception from computephases()

https://www.mercurial-scm.org/repo/hg/rev/3264d58e8b06
changeset:   45176:3264d58e8b06
user:Yuya Nishihara 
date:Sat Jul 18 18:19:14 2020 +0900
summary: phases: fix clang-format error

https://www.mercurial-scm.org/repo/hg/rev/03332e5f67e9
changeset:   45177:03332e5f67e9
user:Yuya Nishihara 
date:Sat Jul 18 18:21:26 2020 +0900
summary: phases: make sure an exception should be set on error return

https://www.mercurial-scm.org/repo/hg/rev/b00fa1782efe
changeset:   45178:b00fa1782efe
user:Yuya Nishihara 
date:Sat Jul 18 18:27:39 2020 +0900
summary: phases: leverage Py_BuildValue() to build PyInt and steal PyObject

https://www.mercurial-scm.org/repo/hg/rev/ba5e4b11d085
changeset:   45179:ba5e4b11d085
user:Yuya Nishihara 
date:Sat Jul 18 18:35:17 2020 +0900
summary: phases: rename variable used for owned dict of phasesets

https://www.mercurial-scm.org/repo/hg/rev/a6fde9d789d9
changeset:   45180:a6fde9d789d9
user:Yuya Nishihara 
date:Sat Jul 18 18:38:46 2020 +0900
summary: phases: move short-lived PyObject pointers to local scope

https://www.mercurial-scm.org/repo/hg/rev/28163c5de797
changeset:   45181:28163c5de797
branch:  stable
tag: 5.5rc0
parent:  45092:e699cebc3ae9
parent:  45180:a6fde9d789d9
user:Pulkit Goyal <7895pul...@gmail.com>
date:Mon Jul 20 21:56:27 2020 +0530
summary: merge default into stable for 5.5rc0

https://www.mercurial-scm.org/repo/hg/rev/8119299e33fe
changeset:   45182:8119299e33fe
branch:  stable
user:Pulkit Goyal <7895pul...@gmail.com>
date:Mon Jul 20 22:16:13 2020 +0530
summary: Added tag 5.5rc0 for changeset 28163c5de797

https://www.mercurial-scm.org/repo/hg/rev/f91f0dfccf9b
changeset:   45183:f91f0dfccf9b
branch:  stable
user:Pulkit Goyal <7895pul...@gmail.com>
date:Mon Jul 20 22:16:26 2020 +0530
summary: Added signature for changeset 28163c5de797

https://www.mercurial-scm.org/repo/hg/rev/3781e9f74b27
changeset:   45184:3781e9f74b27
branch:  stable
user:Yuya Nishihara 
date:Tue Jul 21 20:49:05 2020 +0900
summary: hghave: fix possible int('') in has_clang_format()

https://www.mercurial-scm.org/repo/hg/rev/a17454a189d1
changeset:   45185:a17454a189d1
branch:  stable
tag: tip
user:Yuya Nishihara 
date:Mon Jul 20 20:31:24 2020 +0900
summary: chgserver: discard buffered output before restoring fds (issue6207)

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8781: infinitepush: fix `{get,put}_args` formatting on Python 3

2020-07-21 Thread sheehan (Connor Sheehan)
sheehan created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Calling `.format()` on a byte-string does not work, thus
  causing an exception on Python 3. This commit adds a function
  to paper over the difference.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  hgext/infinitepush/store.py

CHANGE DETAILS

diff --git a/hgext/infinitepush/store.py b/hgext/infinitepush/store.py
--- a/hgext/infinitepush/store.py
+++ b/hgext/infinitepush/store.py
@@ -106,6 +106,23 @@
 return None
 
 
+def format_placeholders_args(args, filename=None, handle=None):
+"""Formats `args` with Infinitepush replacements.
+
+Hack to get `str.format()`-ed strings working in a BC way with
+bytes.
+"""
+formatted_args = []
+for arg in args:
+if filename and arg == b'{filename}':
+formatted_args.append(filename)
+elif handle and arg == b'{handle}':
+formatted_args.append(handle)
+else:
+formatted_args.append(arg)
+return formatted_args
+
+
 class externalbundlestore(abstractbundlestore):
 def __init__(self, put_binary, put_args, get_binary, get_args):
 """
@@ -144,9 +161,9 @@
 temp.write(data)
 temp.flush()
 temp.seek(0)
-formatted_args = [
-arg.format(filename=temp.name) for arg in self.put_args
-]
+formatted_args = format_placeholders_args(
+self.put_args, filename=temp.name
+)
 returncode, stdout, stderr = self._call_binary(
 [self.put_binary] + formatted_args
 )
@@ -166,12 +183,10 @@
 def read(self, handle):
 # Won't work on windows because you can't open file second time without
 # closing it
-# TODO: rewrite without str.format()
 with pycompat.namedtempfile() as temp:
-formatted_args = [
-arg.format(filename=temp.name, handle=handle)
-for arg in self.get_args
-]
+formatted_args = format_placeholders_args(
+self.get_args, filename=temp.name, handle=handle
+)
 returncode, stdout, stderr = self._call_binary(
 [self.get_binary] + formatted_args
 )



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


D8780: infinitepush: replace `NamedTemporaryFile` with `pycompat.namedtempfile`

2020-07-21 Thread sheehan (Connor Sheehan)
sheehan created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Fixes a Python 3 compat error when using the external bundle store.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  hgext/infinitepush/store.py

CHANGE DETAILS

diff --git a/hgext/infinitepush/store.py b/hgext/infinitepush/store.py
--- a/hgext/infinitepush/store.py
+++ b/hgext/infinitepush/store.py
@@ -20,8 +20,6 @@
 procutil,
 )
 
-NamedTemporaryFile = tempfile.NamedTemporaryFile
-
 
 class BundleWriteException(Exception):
 pass
@@ -142,7 +140,7 @@
 # closing it
 # TODO: rewrite without str.format() and replace NamedTemporaryFile()
 # with pycompat.namedtempfile()
-with NamedTemporaryFile() as temp:
+with pycompat.namedtempfile() as temp:
 temp.write(data)
 temp.flush()
 temp.seek(0)
@@ -168,9 +166,8 @@
 def read(self, handle):
 # Won't work on windows because you can't open file second time without
 # closing it
-# TODO: rewrite without str.format() and replace NamedTemporaryFile()
-# with pycompat.namedtempfile()
-with NamedTemporaryFile() as temp:
+# TODO: rewrite without str.format()
+with pycompat.namedtempfile() as temp:
 formatted_args = [
 arg.format(filename=temp.name, handle=handle)
 for arg in self.get_args



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


mercurial@45172: new changeset

2020-07-21 Thread Mercurial Commits
New changeset in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/04c428e93770
changeset:   45172:04c428e93770
bookmark:@
tag: tip
user:Manuel Jacob 
date:Mon Jul 20 17:38:01 2020 +0200
summary: tests: correctly match clang-format version >= 10

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] chgserver: discard buffered output before restoring fds (issue6207)

2020-07-21 Thread Augie Fackler
queued for stable, thanks

> On Jul 21, 2020, at 08:42, Yuya Nishihara  wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1595244684 -32400
> #  Mon Jul 20 20:31:24 2020 +0900
> # Branch stable
> # Node ID 88f93fc8cb3263a3c10143557cb9626dfcf23f4c
> # Parent  f91f0dfccf9b0a928e22bf0041b310712c93903c
> chgserver: discard buffered output before restoring fds (issue6207)
> 
> On Python 3, flush() appears not discarding buffered data on EPIPE, and
> the buffered data will be carried over to the restored stdout.
> 
> diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
> --- a/mercurial/chgserver.py
> +++ b/mercurial/chgserver.py
> @@ -434,8 +434,11 @@ class chgcmdserver(commandserver.server)
> self._oldios.append((ch, fp, fd))
> 
> def _restoreio(self):
> +if not self._oldios:
> +return
> +nullfd = os.open(os.devnull, os.O_WRONLY)
> ui = self.ui
> -for (ch, fp, fd), (cn, fn, _mode) in zip(self._oldios, _iochannels):
> +for (ch, fp, fd), (cn, fn, mode) in zip(self._oldios, _iochannels):
> newfp = getattr(ui, fn)
> # close newfp while it's associated with client; otherwise it
> # would be closed when newfp is deleted
> @@ -443,6 +446,12 @@ class chgcmdserver(commandserver.server)
> newfp.close()
> # restore original fd: fp is open again
> try:
> +if newfp is fp and 'w' in mode:
> +# Discard buffered data which couldn't be flushed because
> +# of EPIPE. The data should belong to the current session
> +# and should never persist.
> +os.dup2(nullfd, fp.fileno())
> +fp.flush()
> os.dup2(fd, fp.fileno())
> except OSError as err:
> # According to issue6330, running chg on heavy loaded systems
> @@ -459,6 +468,7 @@ class chgcmdserver(commandserver.server)
> os.close(fd)
> setattr(self, cn, ch)
> setattr(ui, fn, fp)
> +os.close(nullfd)
> del self._oldios[:]
> 
> def validate(self):
> diff --git a/tests/test-chg.t b/tests/test-chg.t
> --- a/tests/test-chg.t
> +++ b/tests/test-chg.t
> @@ -152,6 +152,49 @@ chg waits for pager if runcommand raises
>   crash-pager: going to crash
>   [255]
> 
> +no stdout data should be printed after pager quits, and the buffered data
> +should never persist (issue6207)
> +
> +"killed!" may be printed if terminated by SIGPIPE, which isn't important
> +in this test.
> +
> +  $ cat > $TESTTMP/bulkwrite.py <<'EOF'
> +  > import time
> +  > from mercurial import error, registrar
> +  > cmdtable = {}
> +  > command = registrar.command(cmdtable)
> +  > @command(b'bulkwrite')
> +  > def bulkwrite(ui, repo, *pats, **opts):
> +  > ui.write(b'going to write massive data\n')
> +  > ui.flush()
> +  > t = time.time()
> +  > while time.time() - t < 2:
> +  > ui.write(b'x' * 1023 + b'\n')  # will be interrupted by SIGPIPE
> +  > raise error.Abort(b"write() doesn't block")
> +  > EOF
> +
> +  $ cat > $TESTTMP/fakepager.py <<'EOF'
> +  > import sys
> +  > import time
> +  > sys.stdout.write('paged! %r\n' % sys.stdin.readline())
> +  > time.sleep(1)  # new data will be written
> +  > EOF
> +
> +  $ cat >> .hg/hgrc < +  > [extensions]
> +  > bulkwrite = $TESTTMP/bulkwrite.py
> +  > EOF
> +
> +  $ chg bulkwrite --pager=on --color no --config ui.formatted=True
> +  paged! 'going to write massive data\n'
> +  killed! (?)
> +  [255]
> +
> +  $ chg bulkwrite --pager=on --color no --config ui.formatted=True
> +  paged! 'going to write massive data\n'
> +  killed! (?)
> +  [255]
> +
>   $ cd ..
> 
> server lifecycle
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH STABLE] hghave: fix possible int('') in has_clang_format()

2020-07-21 Thread Augie Fackler
queued for stable, thanks

> On Jul 21, 2020, at 08:56, Manuel Jacob  wrote:
> 
> On 2020-07-21 14:44, Yuya Nishihara wrote:
>> # HG changeset patch
>> # User Yuya Nishihara 
>> # Date 1595332145 -32400
>> #  Tue Jul 21 20:49:05 2020 +0900
>> # Branch stable
>> # Node ID 31be0ead4581fab624902b53b4a4d2c1d9a8c82a
>> # Parent  88f93fc8cb3263a3c10143557cb9626dfcf23f4c
>> hghave: fix possible int('') in has_clang_format()
>> diff --git a/tests/hghave.py b/tests/hghave.py
>> --- a/tests/hghave.py
>> +++ b/tests/hghave.py
>> @@ -591,7 +591,7 @@ def has_pylint():
>> @check("clang-format", "clang-format C code formatter")
>> def has_clang_format():
>> -m = matchoutput('clang-format --version', br'clang-format version 
>> (\d*)')
>> +m = matchoutput('clang-format --version', br'clang-format version 
>> (\d+)')
> 
> LGTM
> 
>> # style changed somewhere between 4.x and 6.x
>> return m and int(m.group(1)) >= 6
>> ___
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8777: rhg: Ask the error message from `CommandError`

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Avoid repeating the display part of the same error in different commands.
  For example, a lot of commands while use the `FindRoot` `Operation`, rather 
than
  having to display the same error message in different command, the command can
  just return the proper error which know what is the appropriate message to
  display.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/rhg/src/commands/root.rs
  rust/rhg/src/error.rs
  rust/rhg/src/main.rs
  rust/rhg/src/ui.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/ui.rs b/rust/rhg/src/ui.rs
--- a/rust/rhg/src/ui.rs
+++ b/rust/rhg/src/ui.rs
@@ -1,6 +1,7 @@
 use std::io;
 use std::io::Write;
 
+#[derive(Copy, Clone)]
 pub struct Ui {}
 
 /// The kind of user interface error
diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -22,9 +22,11 @@
 std::process::exit(exitcode::UNIMPLEMENTED_COMMAND)
 });
 
+let ui = ui::Ui::new();
+
 let command_result = match matches.subcommand_name() {
 Some(name) => match name {
-"root" => commands::root::RootCommand::new().run(),
+"root" => commands::root::RootCommand::new(ui).run(),
 _ => std::process::exit(exitcode::UNIMPLEMENTED_COMMAND),
 },
 _ => {
@@ -37,6 +39,15 @@
 
 match command_result {
 Ok(_) => std::process::exit(exitcode::OK),
-Err(e) => e.exit(),
+Err(e) => {
+let message = e.get_error_message_bytes();
+if let Some(msg) = message {
+match ui.write_stderr(&msg) {
+Ok(_) => (),
+Err(_) => std::process::exit(exitcode::ABORT),
+};
+};
+e.exit()
+}
 }
 }
diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -1,14 +1,16 @@
 use crate::exitcode;
 use crate::ui::UiError;
+use hg::utils::files::get_bytes_from_path;
 use std::convert::From;
+use std::path::PathBuf;
 
 /// The kind of command error
-#[derive(Debug, PartialEq)]
+#[derive(Debug)]
 pub enum CommandErrorKind {
 /// The root of the repository cannot be found
-RootNotFound,
+RootNotFound(PathBuf),
 /// The current directory cannot be found
-CurrentDirNotFound,
+CurrentDirNotFound(std::io::Error),
 /// The standard output stream cannot be written to
 StdoutError,
 /// The standard error stream cannot be written to
@@ -18,16 +20,43 @@
 impl CommandErrorKind {
 pub fn get_exit_code(&self) -> exitcode::ExitCode {
 match self {
-CommandErrorKind::RootNotFound => exitcode::ABORT,
-CommandErrorKind::CurrentDirNotFound => exitcode::ABORT,
+CommandErrorKind::RootNotFound(_) => exitcode::ABORT,
+CommandErrorKind::CurrentDirNotFound(_) => exitcode::ABORT,
 CommandErrorKind::StdoutError => exitcode::ABORT,
 CommandErrorKind::StderrError => exitcode::ABORT,
 }
 }
+
+pub fn get_error_message_bytes(&self) -> Option> {
+match self {
+// TODO use formating macro
+CommandErrorKind::RootNotFound(path) => {
+let bytes = get_bytes_from_path(path);
+Some(
+[
+b"abort: no repository found in '",
+bytes.as_slice(),
+b"' (.hg not found)!\n",
+]
+.concat(),
+)
+}
+// TODO use formating macro
+CommandErrorKind::CurrentDirNotFound(e) => Some(
+[
+b"abort: error getting current working directory: ",
+e.to_string().as_bytes(),
+b"\n",
+]
+.concat(),
+),
+_ => None,
+}
+}
 }
 
 /// The error type for the Command trait
-#[derive(Debug, PartialEq)]
+#[derive(Debug)]
 pub struct CommandError {
 pub kind: CommandErrorKind,
 }
@@ -37,6 +66,10 @@
 pub fn exit(&self) -> () {
 std::process::exit(self.kind.get_exit_code())
 }
+
+pub fn get_error_message_bytes(&self) -> Option> {
+self.kind.get_error_message_bytes()
+}
 }
 
 impl From for CommandError {
diff --git a/rust/rhg/src/commands/root.rs b/rust/rhg/src/commands/root.rs
--- a/rust/rhg/src/commands/root.rs
+++ b/rust/rhg/src/commands/root.rs
@@ -16,14 +16,23 @@
 }
 
 impl RootCommand {
-pub fn new() -> Self {
-RootCommand { ui: Ui::new() }
+pub fn new(ui: Ui) -> Self {
+RootCommand { ui }
 }
+}
 
-fn display_found_path(
-&self,
-path_buf: PathBuf,
-) -> Result<(), CommandError> {
+impl

D8778: rhg: add a `Files` `Command` to prepare the `rhg files` subcommand

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/rhg/src/commands.rs
  rust/rhg/src/commands/files.rs
  rust/rhg/src/error.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -15,6 +15,8 @@
 StdoutError,
 /// The standard error stream cannot be written to
 StderrError,
+/// The command aborted
+Abort(Option>),
 }
 
 impl CommandErrorKind {
@@ -24,6 +26,7 @@
 CommandErrorKind::CurrentDirNotFound(_) => exitcode::ABORT,
 CommandErrorKind::StdoutError => exitcode::ABORT,
 CommandErrorKind::StderrError => exitcode::ABORT,
+CommandErrorKind::Abort(_) => exitcode::ABORT,
 }
 }
 
@@ -50,6 +53,7 @@
 ]
 .concat(),
 ),
+CommandErrorKind::Abort(message) => message.to_owned(),
 _ => None,
 }
 }
diff --git a/rust/rhg/src/commands/files.rs b/rust/rhg/src/commands/files.rs
new file mode 100644
--- /dev/null
+++ b/rust/rhg/src/commands/files.rs
@@ -0,0 +1,68 @@
+use crate::commands::Command;
+use crate::error::{CommandError, CommandErrorKind};
+use crate::ui::Ui;
+use hg::operations::Operation;
+use hg::operations::{FindRootError, FindRootErrorKind};
+use hg::operations::{
+ListTrackedFiles, ListTrackedFilesError, ListTrackedFilesErrorKind,
+};
+use hg::utils::files::get_bytes_from_path;
+use hg::utils::hg_path::HgPathBuf;
+use std::path::PathBuf;
+
+pub const HELP_TEXT: &str = "
+List tracked files.
+
+Returns 0 on success.
+";
+
+pub struct FilesCommand {
+ui: Ui,
+}
+
+impl FilesCommand {
+pub fn new(ui: Ui) -> Self {
+FilesCommand { ui }
+}
+}
+
+impl Command for FilesCommand {
+fn run(&self) -> Result<(), CommandError> {
+let files =
+ListTrackedFiles::new()
+.run()
+.map_err(|err| match err.kind {
+ListTrackedFilesErrorKind::FindRootError(err) => {
+match err.kind {
+FindRootErrorKind::RootNotFound(path) => {
+CommandErrorKind::RootNotFound(path)
+}
+FindRootErrorKind::GetCurrentDirError(e) => {
+CommandErrorKind::CurrentDirNotFound(e)
+}
+}
+}
+ListTrackedFilesErrorKind::IoError(e) => {
+CommandErrorKind::Abort(Some(
+[b"abort: ", e.to_string().as_bytes(), b"\n"]
+.concat()
+.to_vec(),
+))
+}
+ListTrackedFilesErrorKind::ParseError(_) => {
+CommandErrorKind::Abort(Some(
+// TODO find a better error message
+b"abort: parse error\n".to_vec(),
+))
+}
+})?;
+
+for file in files {
+let bytes = file.as_bytes();
+
+// TODO use formating macro
+self.ui.write_stdout(&[bytes, b"\n"].concat())?;
+}
+Ok(())
+}
+}
diff --git a/rust/rhg/src/commands.rs b/rust/rhg/src/commands.rs
--- a/rust/rhg/src/commands.rs
+++ b/rust/rhg/src/commands.rs
@@ -1,3 +1,4 @@
+pub mod files;
 pub mod root;
 use crate::error::CommandError;
 



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


D8779: rhg: add a limited `rhg files` subcommand

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/rhg/src/main.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -16,6 +16,9 @@
 .version("0.0.1")
 .subcommand(
 SubCommand::with_name("root").about(commands::root::HELP_TEXT),
+)
+.subcommand(
+SubCommand::with_name("files").about(commands::files::HELP_TEXT),
 );
 
 let matches = app.clone().get_matches_safe().unwrap_or_else(|_| {
@@ -27,6 +30,7 @@
 let command_result = match matches.subcommand_name() {
 Some(name) => match name {
 "root" => commands::root::RootCommand::new(ui).run(),
+"files" => commands::files::FilesCommand::new(ui).run(),
 _ => std::process::exit(exitcode::UNIMPLEMENTED_COMMAND),
 },
 _ => {



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


D8776: rhg: Do not return error when when we really mean ok in commands

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Before when a command was successfull `Err(CommandErrorKind::Ok.into())` was
  returned which is an oxymoron. Using `Ok(())` when everything is ok seems more
  appropriate.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/rhg/src/commands/root.rs
  rust/rhg/src/error.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -5,8 +5,6 @@
 /// The kind of command error
 #[derive(Debug, PartialEq)]
 pub enum CommandErrorKind {
-/// The command finished without error
-Ok,
 /// The root of the repository cannot be found
 RootNotFound,
 /// The current directory cannot be found
@@ -20,7 +18,6 @@
 impl CommandErrorKind {
 pub fn get_exit_code(&self) -> exitcode::ExitCode {
 match self {
-CommandErrorKind::Ok => exitcode::OK,
 CommandErrorKind::RootNotFound => exitcode::ABORT,
 CommandErrorKind::CurrentDirNotFound => exitcode::ABORT,
 CommandErrorKind::StdoutError => exitcode::ABORT,
diff --git a/rust/rhg/src/commands/root.rs b/rust/rhg/src/commands/root.rs
--- a/rust/rhg/src/commands/root.rs
+++ b/rust/rhg/src/commands/root.rs
@@ -29,7 +29,7 @@
 // TODO use formating macro
 self.ui.write_stdout(&[bytes.as_slice(), b"\n"].concat())?;
 
-Err(CommandErrorKind::Ok.into())
+Ok(())
 }
 
 fn display_error(&self, error: FindRootError) -> Result<(), CommandError> {



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


D8775: hg-core: implement `Operation` for `ListTrackedFiles`

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Use `parse_dirstate` to list the files tracked in the working directory.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/operations/list_tracked_files.rs
  rust/hg-core/src/operations/mod.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/operations/mod.rs 
b/rust/hg-core/src/operations/mod.rs
--- a/rust/hg-core/src/operations/mod.rs
+++ b/rust/hg-core/src/operations/mod.rs
@@ -1,6 +1,9 @@
 mod find_root;
 mod list_tracked_files;
 pub use find_root::{FindRoot, FindRootError, FindRootErrorKind};
+pub use list_tracked_files::{
+ListTrackedFiles, ListTrackedFilesError, ListTrackedFilesErrorKind,
+};
 
 /// An interface for high-level hg operations.
 ///
diff --git a/rust/hg-core/src/operations/list_tracked_files.rs 
b/rust/hg-core/src/operations/list_tracked_files.rs
--- a/rust/hg-core/src/operations/list_tracked_files.rs
+++ b/rust/hg-core/src/operations/list_tracked_files.rs
@@ -1,10 +1,21 @@
+use super::find_root;
 use super::Operation;
+use crate::dirstate::parsers::parse_dirstate;
 use crate::utils::hg_path::HgPathBuf;
+use crate::DirstateParseError;
+use rayon::prelude::*;
+use std::convert::From;
 use std::fmt;
+use std::fs;
+use std::io;
 
 /// Kind of error encoutered by ListTrackedFiles
 #[derive(Debug)]
-pub enum ListTrackedFilesErrorKind {}
+pub enum ListTrackedFilesErrorKind {
+FindRootError(find_root::FindRootError),
+IoError(io::Error),
+ParseError(DirstateParseError),
+}
 
 /// A ListTrackedFiles error
 #[derive(Debug)]
@@ -21,14 +32,37 @@
 }
 }
 
+impl From for ListTrackedFilesError {
+fn from(kind: ListTrackedFilesErrorKind) -> Self {
+ListTrackedFilesError { kind }
+}
+}
+
 /// List files under Mercurial control in the working directory
 /// by reading the dirstate at .hg/dirstate
 pub struct ListTrackedFiles {}
 
+impl ListTrackedFiles {
+pub fn new() -> Self {
+ListTrackedFiles {}
+}
+}
+
 impl Operation> for ListTrackedFiles {
 type Error = ListTrackedFilesError;
 
 fn run(&self) -> Result, Self::Error> {
-unimplemented!()
+let root = find_root::FindRoot::new()
+.run()
+.map_err(ListTrackedFilesErrorKind::FindRootError)?;
+let dirstate = &root.join(".hg/dirstate");
+let dirstate_content =
+fs::read(&dirstate).map_err(ListTrackedFilesErrorKind::IoError)?;
+let (_, entries, _) = parse_dirstate(&dirstate_content)
+.map_err(ListTrackedFilesErrorKind::ParseError)?;
+let mut files: Vec<_> =
+entries.into_iter().map(|(path, _)| path).collect();
+files.par_sort_unstable();
+Ok(files)
 }
 }



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


D8774: hg-core: make parse_dirstate return result rather than update inplace

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Return a vec rather than updating a hashmap which is faster when then hashmap 
is
  not needed like in `hg files` which just list tracked files.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/dirstate/dirstate_map.rs
  rust/hg-core/src/dirstate/parsers.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/dirstate/parsers.rs 
b/rust/hg-core/src/dirstate/parsers.rs
--- a/rust/hg-core/src/dirstate/parsers.rs
+++ b/rust/hg-core/src/dirstate/parsers.rs
@@ -4,6 +4,7 @@
 // GNU General Public License version 2 or any later version.
 
 use crate::utils::hg_path::HgPath;
+use crate::utils::hg_path::HgPathBuf;
 use crate::{
 dirstate::{CopyMap, EntryState, StateMap},
 DirstateEntry, DirstatePackError, DirstateParents, DirstateParseError,
@@ -19,17 +20,21 @@
 /// Dirstate entries have a static part of 8 + 32 + 32 + 32 + 32 bits.
 const MIN_ENTRY_SIZE: usize = 17;
 
-// TODO parse/pack: is mutate-on-loop better for performance?
+type ParseResult = (
+DirstateParents,
+Vec<(HgPathBuf, DirstateEntry)>,
+Vec<(HgPathBuf, HgPathBuf)>,
+);
 
 #[timed]
 pub fn parse_dirstate(
-state_map: &mut StateMap,
-copy_map: &mut CopyMap,
 contents: &[u8],
-) -> Result {
+) -> Result {
 if contents.len() < PARENT_SIZE * 2 {
 return Err(DirstateParseError::TooLittleData);
 }
+let mut copies: Vec<(HgPathBuf, HgPathBuf)> = vec![];
+let mut entries: Vec<(HgPathBuf, DirstateEntry)> = vec![];
 
 let mut curr_pos = PARENT_SIZE * 2;
 let parents = DirstateParents {
@@ -63,12 +68,12 @@
 };
 
 if let Some(copy_path) = copy {
-copy_map.insert(
-HgPath::new(path).to_owned(),
-HgPath::new(copy_path).to_owned(),
-);
+copies.push((
+HgPathBuf::from_bytes(path),
+HgPathBuf::from_bytes(copy_path),
+));
 };
-state_map.insert(
+entries.push((
 HgPath::new(path).to_owned(),
 DirstateEntry {
 state,
@@ -76,11 +81,11 @@
 size,
 mtime,
 },
-);
+));
 curr_pos = curr_pos + MIN_ENTRY_SIZE + (path_len);
 }
 
-Ok(parents)
+Ok((parents, entries, copies))
 }
 
 /// `now` is the duration in seconds since the Unix epoch
@@ -287,12 +292,11 @@
 
 let mut new_state_map: StateMap = FastHashMap::default();
 let mut new_copy_map: CopyMap = FastHashMap::default();
-let new_parents = parse_dirstate(
-&mut new_state_map,
-&mut new_copy_map,
-result.as_slice(),
-)
-.unwrap();
+let (new_parents, entries, copies) =
+parse_dirstate(result.as_slice()).unwrap();
+new_state_map.extend(entries);
+new_copy_map.extend(copies);
+
 assert_eq!(
 (parents, state_map, copymap),
 (new_parents, new_state_map, new_copy_map)
@@ -362,12 +366,11 @@
 
 let mut new_state_map: StateMap = FastHashMap::default();
 let mut new_copy_map: CopyMap = FastHashMap::default();
-let new_parents = parse_dirstate(
-&mut new_state_map,
-&mut new_copy_map,
-result.as_slice(),
-)
-.unwrap();
+let (new_parents, entries, copies) =
+parse_dirstate(result.as_slice()).unwrap();
+new_state_map.extend(entries);
+new_copy_map.extend(copies);
+
 assert_eq!(
 (parents, state_map, copymap),
 (new_parents, new_state_map, new_copy_map)
@@ -405,12 +408,10 @@
 
 let mut new_state_map: StateMap = FastHashMap::default();
 let mut new_copy_map: CopyMap = FastHashMap::default();
-let new_parents = parse_dirstate(
-&mut new_state_map,
-&mut new_copy_map,
-result.as_slice(),
-)
-.unwrap();
+let (new_parents, entries, copies) =
+parse_dirstate(result.as_slice()).unwrap();
+new_state_map.extend(entries);
+new_copy_map.extend(copies);
 
 assert_eq!(
 (
diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs 
b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -364,11 +364,9 @@
 return Ok(None);
 }
 
-let parents = parse_dirstate(
-&mut self.state_map,
-&mut self.copy_map,
-file_contents,
-)?;
+let (parents, entries, copies) = parse_dirstate(file_contents)?;
+self.state_map.extend(entries);
+self.copy_map.extend(copies);
 
 if !self.dirty_parents {
 self.set_parents(&parents);



D8773: hg-core: define a `ListTrackedFiles` `Operation`

2020-07-21 Thread acezar (Antoine Cezar)
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  List files under Mercurial control in the working directory
  by reading the dirstate at .hg/dirstate.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  rust/hg-core/src/operations/list_tracked_files.rs
  rust/hg-core/src/operations/mod.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/operations/mod.rs 
b/rust/hg-core/src/operations/mod.rs
--- a/rust/hg-core/src/operations/mod.rs
+++ b/rust/hg-core/src/operations/mod.rs
@@ -1,4 +1,5 @@
 mod find_root;
+mod list_tracked_files;
 pub use find_root::{FindRoot, FindRootError, FindRootErrorKind};
 
 /// An interface for high-level hg operations.
diff --git a/rust/hg-core/src/operations/list_tracked_files.rs 
b/rust/hg-core/src/operations/list_tracked_files.rs
new file mode 100644
--- /dev/null
+++ b/rust/hg-core/src/operations/list_tracked_files.rs
@@ -0,0 +1,34 @@
+use super::Operation;
+use crate::utils::hg_path::HgPathBuf;
+use std::fmt;
+
+/// Kind of error encoutered by ListTrackedFiles
+#[derive(Debug)]
+pub enum ListTrackedFilesErrorKind {}
+
+/// A ListTrackedFiles error
+#[derive(Debug)]
+pub struct ListTrackedFilesError {
+/// Kind of error encoutered by ListTrackedFiles
+pub kind: ListTrackedFilesErrorKind,
+}
+
+impl std::error::Error for ListTrackedFilesError {}
+
+impl fmt::Display for ListTrackedFilesError {
+fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
+unimplemented!()
+}
+}
+
+/// List files under Mercurial control in the working directory
+/// by reading the dirstate at .hg/dirstate
+pub struct ListTrackedFiles {}
+
+impl Operation> for ListTrackedFiles {
+type Error = ListTrackedFilesError;
+
+fn run(&self) -> Result, Self::Error> {
+unimplemented!()
+}
+}



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


D8772: localrepo: abort creating a shared repo if the source does not have store

2020-07-21 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We cannot create a shared repository without a store IIUC. Let's abort in such
  cases.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3663,6 +3663,13 @@
 )
 dropped.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT)
 
+if b'shared' in requirements or b'relshared' in requirements:
+raise error.Abort(
+_(
+b"cannot create shared repository as source does not have 
'store' requirement"
+)
+)
+
 return dropped
 
 



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


Re: [PATCH STABLE] hghave: fix possible int('') in has_clang_format()

2020-07-21 Thread Manuel Jacob

On 2020-07-21 14:44, Yuya Nishihara wrote:

# HG changeset patch
# User Yuya Nishihara 
# Date 1595332145 -32400
#  Tue Jul 21 20:49:05 2020 +0900
# Branch stable
# Node ID 31be0ead4581fab624902b53b4a4d2c1d9a8c82a
# Parent  88f93fc8cb3263a3c10143557cb9626dfcf23f4c
hghave: fix possible int('') in has_clang_format()

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -591,7 +591,7 @@ def has_pylint():

 @check("clang-format", "clang-format C code formatter")
 def has_clang_format():
-m = matchoutput('clang-format --version', br'clang-format version 
(\d*)')
+m = matchoutput('clang-format --version', br'clang-format version 
(\d+)')


LGTM


 # style changed somewhere between 4.x and 6.x
 return m and int(m.group(1)) >= 6

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH STABLE] hghave: fix possible int('') in has_clang_format()

2020-07-21 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1595332145 -32400
#  Tue Jul 21 20:49:05 2020 +0900
# Branch stable
# Node ID 31be0ead4581fab624902b53b4a4d2c1d9a8c82a
# Parent  88f93fc8cb3263a3c10143557cb9626dfcf23f4c
hghave: fix possible int('') in has_clang_format()

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -591,7 +591,7 @@ def has_pylint():
 
 @check("clang-format", "clang-format C code formatter")
 def has_clang_format():
-m = matchoutput('clang-format --version', br'clang-format version (\d*)')
+m = matchoutput('clang-format --version', br'clang-format version (\d+)')
 # style changed somewhere between 4.x and 6.x
 return m and int(m.group(1)) >= 6
 
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH STABLE] chgserver: discard buffered output before restoring fds (issue6207)

2020-07-21 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1595244684 -32400
#  Mon Jul 20 20:31:24 2020 +0900
# Branch stable
# Node ID 88f93fc8cb3263a3c10143557cb9626dfcf23f4c
# Parent  f91f0dfccf9b0a928e22bf0041b310712c93903c
chgserver: discard buffered output before restoring fds (issue6207)

On Python 3, flush() appears not discarding buffered data on EPIPE, and
the buffered data will be carried over to the restored stdout.

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -434,8 +434,11 @@ class chgcmdserver(commandserver.server)
 self._oldios.append((ch, fp, fd))
 
 def _restoreio(self):
+if not self._oldios:
+return
+nullfd = os.open(os.devnull, os.O_WRONLY)
 ui = self.ui
-for (ch, fp, fd), (cn, fn, _mode) in zip(self._oldios, _iochannels):
+for (ch, fp, fd), (cn, fn, mode) in zip(self._oldios, _iochannels):
 newfp = getattr(ui, fn)
 # close newfp while it's associated with client; otherwise it
 # would be closed when newfp is deleted
@@ -443,6 +446,12 @@ class chgcmdserver(commandserver.server)
 newfp.close()
 # restore original fd: fp is open again
 try:
+if newfp is fp and 'w' in mode:
+# Discard buffered data which couldn't be flushed because
+# of EPIPE. The data should belong to the current session
+# and should never persist.
+os.dup2(nullfd, fp.fileno())
+fp.flush()
 os.dup2(fd, fp.fileno())
 except OSError as err:
 # According to issue6330, running chg on heavy loaded systems
@@ -459,6 +468,7 @@ class chgcmdserver(commandserver.server)
 os.close(fd)
 setattr(self, cn, ch)
 setattr(ui, fn, fp)
+os.close(nullfd)
 del self._oldios[:]
 
 def validate(self):
diff --git a/tests/test-chg.t b/tests/test-chg.t
--- a/tests/test-chg.t
+++ b/tests/test-chg.t
@@ -152,6 +152,49 @@ chg waits for pager if runcommand raises
   crash-pager: going to crash
   [255]
 
+no stdout data should be printed after pager quits, and the buffered data
+should never persist (issue6207)
+
+"killed!" may be printed if terminated by SIGPIPE, which isn't important
+in this test.
+
+  $ cat > $TESTTMP/bulkwrite.py <<'EOF'
+  > import time
+  > from mercurial import error, registrar
+  > cmdtable = {}
+  > command = registrar.command(cmdtable)
+  > @command(b'bulkwrite')
+  > def bulkwrite(ui, repo, *pats, **opts):
+  > ui.write(b'going to write massive data\n')
+  > ui.flush()
+  > t = time.time()
+  > while time.time() - t < 2:
+  > ui.write(b'x' * 1023 + b'\n')  # will be interrupted by SIGPIPE
+  > raise error.Abort(b"write() doesn't block")
+  > EOF
+
+  $ cat > $TESTTMP/fakepager.py <<'EOF'
+  > import sys
+  > import time
+  > sys.stdout.write('paged! %r\n' % sys.stdin.readline())
+  > time.sleep(1)  # new data will be written
+  > EOF
+
+  $ cat >> .hg/hgrc < [extensions]
+  > bulkwrite = $TESTTMP/bulkwrite.py
+  > EOF
+
+  $ chg bulkwrite --pager=on --color no --config ui.formatted=True
+  paged! 'going to write massive data\n'
+  killed! (?)
+  [255]
+
+  $ chg bulkwrite --pager=on --color no --config ui.formatted=True
+  paged! 'going to write massive data\n'
+  killed! (?)
+  [255]
+
   $ cd ..
 
 server lifecycle
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6381] New: histedit should inform hg summary about its plan and current state

2020-07-21 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6381

Bug ID: 6381
   Summary: histedit should inform hg summary about its plan and
current state
   Product: Mercurial
   Version: stable branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: histedit
  Assignee: bugzi...@mercurial-scm.org
  Reporter: antoine.ce...@octobus.net
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

During histedit execution, this two informations should be available in hg
summary:
 - what histedit has planned to do
 - what is the current histedit operation

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6380] New: histedit should give more information when a merge conflict is encountered

2020-07-21 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6380

Bug ID: 6380
   Summary: histedit should give more information when a merge
conflict is encountered
   Product: Mercurial
   Version: stable branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: histedit
  Assignee: bugzi...@mercurial-scm.org
  Reporter: antoine.ce...@octobus.net
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

When a merge conflict is encountered. There is too little information to
understand where we are and what was done when the conflict arise:

  performing changes
  merging src/main.rs
  warning: conflicts while merging src/main.rs! (edit, then use 'hg resolve
--mark')
  Fix up the change (pick c1ba807f576c)
  (hg histedit --continue to resume)

I'd like to have:
  - the changset short description rather that having to search the hash in log
  - the performed change

Example:

  performing fold {node1} on {node2}
  {node1}: {oneline decription}
  {node2}: {oneline decription}
  merging src/main.rs
  warning: conflicts while merging src/main.rs! (edit, then use 'hg resolve
--mark')
  Fix up the change (pick c1ba807f576c)
  (hg histedit --continue to resume)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6379] New: editmerge should be an internal tool

2020-07-21 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6379

Bug ID: 6379
   Summary: editmerge should be an internal tool
   Product: Mercurial
   Version: stable branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: antoine.ce...@octobus.net
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

enabling editmerge with:

  [ui]
  merge=:editmerge

would be easier than (which only work with a checkout of the source):


  [ui]
  merge=editmerge

  [merge-tools]
  editmerge.premerge=keep-merge3
  editmerge.executable=~/src/mercurial-dev/contrib/editmerge

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6378] New: hg summary should give more details about in progress evolution

2020-07-21 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6378

Bug ID: 6378
   Summary: hg summary should give more details about in progress
evolution
   Product: Mercurial
   Version: stable branch
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: antoine.ce...@octobus.net
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org
Python Version: ---

While in conflict summary should give info about which revision is being
evolved on which revision.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D8771: localrepo: only use BOOKMARKS_IN_STORE_REQUIRMENT is we have a store

2020-07-21 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This adds check that if we are using store and if we are not, we skip adding 
the
  BOOKMARKS_IN_STORE_REQUIREMENT.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3548,6 +3548,7 @@
 Extensions can wrap this function to specify custom requirements for
 new repositories.
 """
+usestore = False
 # If the repo is being created from a shared repository, we copy
 # its requirements.
 if b'sharedrepo' in createopts:
@@ -3576,6 +3577,7 @@
 
 requirements = {b'revlogv1'}
 if ui.configbool(b'format', b'usestore'):
+usestore = True
 requirements.add(b'store')
 if ui.configbool(b'format', b'usefncache'):
 requirements.add(b'fncache')
@@ -3636,7 +3638,7 @@
 if createopts.get(b'lfs'):
 requirements.add(b'lfs')
 
-if ui.configbool(b'format', b'bookmarks-in-store'):
+if ui.configbool(b'format', b'bookmarks-in-store') and usestore:
 requirements.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT)
 
 if ui.configbool(b'format', b'use-persistent-nodemap'):



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