Re: Discussion about Mercurial 4.8 Sprint
On Thu, Jul 12, 2018 at 9:11 PM Sean Farley wrote: > > Martin von Zweigbergk writes: > > > On Thu, Jul 12, 2018, 17:41 Sean Farley wrote: > > > >> > >> Martin von Zweigbergk via Mercurial-devel < > >> mercurial-devel@mercurial-scm.org> writes: > >> > >> > Since there was no consensus in this thread, we discussed it in the > >> > steering committee. We decided to do it in Europe this time (i.e. the > 4.8 > >> > sprint) since everyone indicated that they could make it there. We > also > >> > decided to do it Oct 12-14 and to do it in Stockholm. I'll send a > >> separate > >> > email to the list about that. > >> > >> I guess I'm really confused about this. In this thread, many people, > >> myself included, offered to help and even began the process of securing > >> a meeting location. > >> > >> Could you please provide insight on how the decision was made? Were > >> venue offers made privately? > >> > > > > No offers made privately (why do you ask?), the offers we had were on the > > wiki. Those offers were Tokyo, Lyon, and Stockholm. According to the > > availability table, everyone was able to come to Europe, but not everyone > > could make it to Asia, so we decided not to do it in Tokyo this time. The > > Lyon location was an hour or two further away from most locations and the > > Stockholm location (except from France, of course). So I proposed doing > it > > in Stockholm and no one objected. > > In this thread, we talked and made plans so far for some place in France > (either Paris or Lyon). The wiki page you mentioned is an opt-in only > notification and I haven't edited that page nor was I subscribed which > is why I asked about private offers. Not everyone on this mailing list > got those notifications... so, of course, no one objected because not > many of us even knew Stockholm was a serious contender. > I updated this thread saying that we'd updated wiki with availability for Tokyo and Stockholm. There wasn't much more than a mention of Lyon and Paris either, so I don't know why Stockholm would be less serious. > It feels like a decision was made without involving the rest of the > community that was already discussing this sprint. > I can understand that it felt that way, and I'm sorry about that. I suppose we could have decided only between Asia and Europe to start with and then updated the Availability table on the wiki to have Lyon/Stockholm columns instead (Paris didn't seem realistic given the small space). That would clearly have delayed the decision (by a week? two?), but perhaps that would have been fine given that the sprint ended up being quite late in the fall this time. At least I (I don't know about others) felt like it was better to decide something than to hear everyone's point of view, because I had a feeling we would not reach consensus even if we did. Let's try to start planning next sprint earlier (soon), so this doesn't happen again. By the way, you haven't added your name to the wiki. Will we see you there? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Discussion about Mercurial 4.8 Sprint
Martin von Zweigbergk writes: > On Thu, Jul 12, 2018, 17:41 Sean Farley wrote: > >> >> Martin von Zweigbergk via Mercurial-devel < >> mercurial-devel@mercurial-scm.org> writes: >> >> > Since there was no consensus in this thread, we discussed it in the >> > steering committee. We decided to do it in Europe this time (i.e. the 4.8 >> > sprint) since everyone indicated that they could make it there. We also >> > decided to do it Oct 12-14 and to do it in Stockholm. I'll send a >> separate >> > email to the list about that. >> >> I guess I'm really confused about this. In this thread, many people, >> myself included, offered to help and even began the process of securing >> a meeting location. >> >> Could you please provide insight on how the decision was made? Were >> venue offers made privately? >> > > No offers made privately (why do you ask?), the offers we had were on the > wiki. Those offers were Tokyo, Lyon, and Stockholm. According to the > availability table, everyone was able to come to Europe, but not everyone > could make it to Asia, so we decided not to do it in Tokyo this time. The > Lyon location was an hour or two further away from most locations and the > Stockholm location (except from France, of course). So I proposed doing it > in Stockholm and no one objected. In this thread, we talked and made plans so far for some place in France (either Paris or Lyon). The wiki page you mentioned is an opt-in only notification and I haven't edited that page nor was I subscribed which is why I asked about private offers. Not everyone on this mailing list got those notifications... so, of course, no one objected because not many of us even knew Stockholm was a serious contender. It feels like a decision was made without involving the rest of the community that was already discussing this sprint. signature.asc Description: PGP signature ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Discussion about Mercurial 4.8 Sprint
On Thu, Jul 12, 2018, 17:41 Sean Farley wrote: > > Martin von Zweigbergk via Mercurial-devel < > mercurial-devel@mercurial-scm.org> writes: > > > Since there was no consensus in this thread, we discussed it in the > > steering committee. We decided to do it in Europe this time (i.e. the 4.8 > > sprint) since everyone indicated that they could make it there. We also > > decided to do it Oct 12-14 and to do it in Stockholm. I'll send a > separate > > email to the list about that. > > I guess I'm really confused about this. In this thread, many people, > myself included, offered to help and even began the process of securing > a meeting location. > > Could you please provide insight on how the decision was made? Were > venue offers made privately? > No offers made privately (why do you ask?), the offers we had were on the wiki. Those offers were Tokyo, Lyon, and Stockholm. According to the availability table, everyone was able to come to Europe, but not everyone could make it to Asia, so we decided not to do it in Tokyo this time. The Lyon location was an hour or two further away from most locations and the Stockholm location (except from France, of course). So I proposed doing it in Stockholm and no one objected. I'm that we didn't realize/remember that you were spending time and effort on finding a location. > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Discussion about Mercurial 4.8 Sprint
Martin von Zweigbergk via Mercurial-devel writes: > Since there was no consensus in this thread, we discussed it in the > steering committee. We decided to do it in Europe this time (i.e. the 4.8 > sprint) since everyone indicated that they could make it there. We also > decided to do it Oct 12-14 and to do it in Stockholm. I'll send a separate > email to the list about that. I guess I'm really confused about this. In this thread, many people, myself included, offered to help and even began the process of securing a meeting location. Could you please provide insight on how the decision was made? Were venue offers made privately? signature.asc Description: PGP signature ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3942: rebase: use revnums (not nodes) for set of extinct revisions
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY There is no need to convert extinct revisions to nodeids. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3942 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1855,22 +1855,22 @@ assert repo.filtername is None cl = repo.changelog nodemap = cl.nodemap -extinctnodes = set(cl.node(r) for r in repo.revs('extinct()')) +extinctrevs = set(repo.revs('extinct()')) for srcrev in rebaseobsrevs: srcnode = cl.node(srcrev) # XXX: more advanced APIs are required to handle split correctly successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode])) # obsutil.allsuccessors includes node itself successors.remove(srcnode) -if successors.issubset(extinctnodes): +succrevs = {nodemap[s] for s in successors if s in nodemap} +if succrevs.issubset(extinctrevs): # all successors are extinct obsoleteextinctsuccessors.add(srcrev) if not successors: # no successor obsoletenotrebased[srcrev] = None else: dstrev = destmap[srcrev] -succrevs = [nodemap[s] for s in successors if s in nodemap] for succrev in succrevs: if cl.isancestorrev(succrev, dstrev): obsoletenotrebased[srcrev] = succrev To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3941: rebase: avoid converting from nodes to revnums twice
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY In the case where the node has successors, but none of them is an ancestor of the destination, we would iterate over the successor nodes twice, check if they're in the repo and convert them to revnums. I doubt it's a measureable cost, but it gets simpler this way too. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3941 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1869,19 +1869,17 @@ # no successor obsoletenotrebased[srcrev] = None else: -destnode = cl.node(destmap[srcrev]) -for succnode in successors: -if succnode not in nodemap: -continue -if cl.isancestor(succnode, destnode): -obsoletenotrebased[srcrev] = nodemap[succnode] +dstrev = destmap[srcrev] +succrevs = [nodemap[s] for s in successors if s in nodemap] +for succrev in succrevs: +if cl.isancestorrev(succrev, dstrev): +obsoletenotrebased[srcrev] = succrev break else: # If 'srcrev' has a successor in rebase set but none in # destination (which would be catched above), we shall skip it # and its descendants to avoid divergence. -if any(nodemap[s] in destmap for s in successors - if s in nodemap): +if any(s in destmap for s in succrevs): obsoletewithoutsuccessorindestination.add(srcrev) return ( To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3940: rebase: reduce scope of a variable
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3940 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1858,7 +1858,6 @@ extinctnodes = set(cl.node(r) for r in repo.revs('extinct()')) for srcrev in rebaseobsrevs: srcnode = cl.node(srcrev) -destnode = cl.node(destmap[srcrev]) # XXX: more advanced APIs are required to handle split correctly successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode])) # obsutil.allsuccessors includes node itself @@ -1870,6 +1869,7 @@ # no successor obsoletenotrebased[srcrev] = None else: +destnode = cl.node(destmap[srcrev]) for succnode in successors: if succnode not in nodemap: continue To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3937: ssh: avoid reading beyond the end of stream when using compression
joerg.sonnenberger updated this revision to Diff 9576. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3937?vs=9573=9576 REVISION DETAIL https://phab.mercurial-scm.org/D3937 AFFECTED FILES mercurial/sshpeer.py mercurial/util.py CHANGE DETAILS diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -355,6 +355,11 @@ self._fillbuffer() return self._frombuffer(size) +def unbufferedread(self, size): +if not self._eof and self._lenbuf == 0: +self._fillbuffer(max(size, _chunksize)) +return self._frombuffer(min(self._lenbuf, size)) + def readline(self, *args, **kwargs): if 1 < len(self._buffer): # this should not happen because both read and readline end with a @@ -396,9 +401,9 @@ self._lenbuf = 0 return data -def _fillbuffer(self): +def _fillbuffer(self, size=_chunksize): """read data to the buffer""" -data = os.read(self._input.fileno(), _chunksize) +data = os.read(self._input.fileno(), size) if not data: self._eof = True else: @@ -3328,6 +,104 @@ """ raise NotImplementedError() +class _CompressedStreamReader(object): +def __init__(self, fh): +if safehasattr(fh, 'unbufferedread'): +self._reader = fh.unbufferedread +else: +self._reader = fh.read +self._pending = [] +self._pos = 0 +self._eof = False + +def _decompress(self, chunk): +raise NotImplementedError() + +def read(self, l): +buf = [] +while True: +while self._pending: +if len(self._pending[0]) > l + self._pos: +newbuf = self._pending[0] +buf.append(newbuf[self._pos:self._pos + l]) +self._pos += l +return ''.join(buf) + +newbuf = self._pending.pop(0) +if self._pos: +buf.append(newbuf[self._pos:]) +l -= len(newbuf) - self._pos +else: +buf.append(newbuf) +l -= len(newbuf) +self._pos = 0 + +if self._eof: +return ''.join(buf) +chunk = self._reader(65536) +self._decompress(chunk) + +class _GzipCompressedStreamReader(_CompressedStreamReader): +def __init__(self, fh): +super(_GzipCompressedStreamReader, self).__init__(fh) +self._decompobj = zlib.decompressobj() +def _decompress(self, chunk): +newbuf = self._decompobj.decompress(chunk) +if newbuf: +self._pending.append(newbuf) +d = self._decompobj.copy() +try: +d.decompress('x') +d.flush() +if d.unused_data == 'x': +self._eof = True +except zlib.error: +pass + +class _BZ2CompressedStreamReader(_CompressedStreamReader): +def __init__(self, fh): +super(_BZ2CompressedStreamReader, self).__init__(fh) +self._decompobj = bz2.BZ2Decompressor() +def _decompress(self, chunk): +newbuf = self._decompobj.decompress(chunk) +if newbuf: +self._pending.append(newbuf) +try: +while True: +newbuf = self._decompobj.decompress('') +if newbuf: +self._pending.append(newbuf) +else: +break +except EOFError: +self._eof = True + +class _TruncatedBZ2CompressedStreamReader(_BZ2CompressedStreamReader): +def __init__(self, fh): +super(_TruncatedBZ2CompressedStreamReader, self).__init__(fh) +newbuf = self._decompobj.decompress('BZ') +if newbuf: +self._pending.append(newbuf) + +class _ZstdCompressedStreamReader(_CompressedStreamReader): +def __init__(self, fh, zstd): +super(_ZstdCompressedStreamReader, self).__init__(fh) +self._zstd = zstd +self._decompobj = zstd.ZstdDecompressor().decompressobj() +def _decompress(self, chunk): +newbuf = self._decompobj.decompress(chunk) +if newbuf: +self._pending.append(newbuf) +try: +while True: +newbuf = self._decompobj.decompress('') +if newbuf: +self._pending.append(newbuf) +else: +break +except self._zstd.ZstdError: +self._eof = True + class _zlibengine(compressionengine): def name(self): return 'zlib' @@ -3361,15 +3464,7 @@ yield z.flush() def decompressorreader(self, fh): -def gen(): -d = zlib.decompressobj() -for chunk in filechunkiter(fh): -while chunk: -# Limit output size to limit
D3870: rebase: add --confirm option
khanchi97 added a comment. >> except error.InMemoryMergeConflictsError: >> ui.status(_('hit a merge conflict\n')) >> >> +if confirm: >> +# abort as in-memory merge doesn't support conflict >> +rbsrt._prepareabortorcontinue(isabort=True, backup=False, >> + suppwarns=True) >> +needsabort = False >> +if not ui.promptchoice(_(b'apply changes (yn)?' >> + b'$$ $$ ')): > > Nit: This isn't actually "apply changes". Hmm, then what it should be? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3870 To: khanchi97, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3939: rebase: correct misleading message in --confirm option
khanchi97 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3939 AFFECTED FILES hgext/rebase.py tests/test-rebase-inmemory.t CHANGE DETAILS diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t --- a/tests/test-rebase-inmemory.t +++ b/tests/test-rebase-inmemory.t @@ -369,7 +369,7 @@ $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF > n > EOF - starting rebase... + starting in-memory rebase rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" @@ -400,7 +400,7 @@ $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF > y > EOF - starting rebase... + starting in-memory rebase rebasing 2:177f92b77385 "c" rebasing 3:055a42cdd887 "d" rebasing 4:e860deea161a "e" @@ -475,7 +475,7 @@ $ hg rebase -s 4 -d . --keep --config ui.interactive=True --confirm << EOF > n > EOF - starting rebase... + starting in-memory rebase rebasing 4:e860deea161a "e" merging e hit a merge conflict @@ -516,7 +516,7 @@ $ hg rebase -s 4 -d . --keep --config ui.interactive=True --confirm << EOF > y > EOF - starting rebase... + starting in-memory rebase rebasing 4:e860deea161a "e" merging e hit a merge conflict diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -854,7 +854,7 @@ rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts) confirm = opts.get('confirm') if confirm: -ui.status(_('starting rebase...\n')) +ui.status(_('starting in-memory rebase\n')) else: ui.status(_('starting dry-run rebase; repository will not be ' 'changed\n')) To: khanchi97, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3938: rebase: make sure we don't loose the return code in --confirm option
khanchi97 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY return _dorebase() to make sure it returns 'return code'. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3938 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -874,7 +874,7 @@ needsabort = False if not ui.promptchoice(_(b'apply changes (yn)?' b'$$ $$ ')): -_dorebase(ui, repo, opts, inmemory=False) +return _dorebase(ui, repo, opts, inmemory=False) return 1 else: if confirm: To: khanchi97, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3937: ssh: avoid reading beyond the end of stream when using compression
joerg.sonnenberger created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Compressed streams can be used as part of getbundle. The normal read() operation of bufferedinputpipe will try to fulfill the request exactly and can deadlock if the server sends less as it is done. At the same time, the bundle2 logic will stop reading when it believes it has gotten all parts of the bundle, which can leave behind end of stream markers as used by bzip2 and zstd. To solve this, introduce a new optional unbufferedread interface and provided it in bufferedinputpipe and doublepipe. If there is buffered data left, it will be returned, otherwise it will issue a single read request and return whatever it obtains. Reorganize the decompression handlers to try harder to read until the end of stream, especially if the requested read can already be fulfilled. Check for end of stream is messy with Python 2, none of the standard compression modules properly exposes it. At least with zstd and bzip2, decompressing will remember EOS and fail for empty input after the EOS has been seen. For zlib, the only way to detect it with Python 2 is to duplicate the decompressobj and force some additional data into it. The common handler can be further optimized, but works as PoC. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3937 AFFECTED FILES mercurial/sshpeer.py mercurial/util.py CHANGE DETAILS diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -355,6 +355,11 @@ self._fillbuffer() return self._frombuffer(size) +def unbufferedread(self, size): +if not self._eof and self._lenbuf == 0: +self._fillbuffer(max(size, _chunksize)) +return self._frombuffer(min(self._lenbuf, size)) + def readline(self, *args, **kwargs): if 1 < len(self._buffer): # this should not happen because both read and readline end with a @@ -396,9 +401,9 @@ self._lenbuf = 0 return data -def _fillbuffer(self): +def _fillbuffer(self, size = _chunksize): """read data to the buffer""" -data = os.read(self._input.fileno(), _chunksize) +data = os.read(self._input.fileno(), size) if not data: self._eof = True else: @@ -3328,6 +,98 @@ """ raise NotImplementedError() +class _CompressedStreamReader(object): +def __init__(self, fh): +if safehasattr(fh, 'unbufferedread'): +self._reader = fh.unbufferedread +else: +self._reader = fh.read +self._pending = [] +self._eof = False + +def _decompress(self, chunk): +raise NotImplementedError() + +def read(self, l): +buf = [] +while True: +while self._pending: +if len(self._pending[0]) > l: +newbuf = self._pending[0] +buf.append(newbuf[:l]) +self._pending[0] = newbuf[l:] +return ''.join(buf) + +newbuf = self._pending.pop(0) +buf.append(newbuf) +l -= len(newbuf) + +if self._eof: +return ''.join(buf) +chunk = self._reader(65536) +self._decompress(chunk) + +class _GzipCompressedStreamReader(_CompressedStreamReader): +def __init__(self, fh): +super(_GzipCompressedStreamReader, self).__init__(fh) +self._decompobj = zlib.decompressobj() +def _decompress(self, chunk): +newbuf = self._decompobj.decompress(chunk) +if newbuf: +self._pending.append(newbuf) +d = self._decompobj.copy() +try: +d.decompress('x') +d.flush() +if d.unused_data == 'x': +self._eof = True +except zlib.error: +pass + +class _BZ2CompressedStreamReader(_CompressedStreamReader): +def __init__(self, fh): +super(_BZ2CompressedStreamReader, self).__init__(fh) +self._decompobj = bz2.BZ2Decompressor() +def _decompress(self, chunk): +newbuf = self._decompobj.decompress(chunk) +if newbuf: +self._pending.append(newbuf) +try: +while True: +newbuf = self._decompobj.decompress('') +if newbuf: +self._pending.append(newbuf) +else: +break +except EOFError: +self._eof = True + +class _TruncatedBZ2CompressedStreamReader(_BZ2CompressedStreamReader): +def __init__(self, fh): +super(_TruncatedBZ2CompressedStreamReader, self).__init__(fh) +newbuf = self._decompobj.decompress('BZ') +if newbuf: +self._pending.append(newbuf) + +class
D3936: context: rename descendant() to isancestorof()
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This makes the direction much clearer, IMO. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3936 AFFECTED FILES mercurial/bookmarks.py mercurial/context.py mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -416,14 +416,14 @@ # common ancestor or not without explicitly checking it, it's better to # determine that here. # -# base.descendant(wc) is False, work around that +# base.isancestorof(wc) is False, work around that _c1 = c1.p1() if c1.rev() is None else c1 _c2 = c2.p1() if c2.rev() is None else c2 # an endpoint is "dirty" if it isn't a descendant of the merge base # if we have a dirty endpoint, we need to trigger graft logic, and also # keep track of which endpoint is dirty -dirtyc1 = not base.descendant(_c1) -dirtyc2 = not base.descendant(_c2) +dirtyc1 = not base.isancestorof(_c1) +dirtyc2 = not base.isancestorof(_c2) graft = dirtyc1 or dirtyc2 tca = base if graft: diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -589,8 +589,8 @@ short(n) for n in sorted(cahs) if n != anc)) return changectx(self._repo, anc) -def descendant(self, other): -"""True if other is descendant of this changeset""" +def isancestorof(self, other): +"""True if this changeset is an ancestor of other""" return self._repo.changelog.isancestorrev(self._rev, other._rev) def walk(self, match): diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -813,7 +813,7 @@ return new.node() in obsutil.foreground(repo, [old.node()]) else: # still an independent clause as it is lazier (and therefore faster) -return old.descendant(new) +return old.isancestorof(new) def checkformat(repo, mark): """return a valid version of a potential bookmark name To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3934: revlog: delete isdescendantrev() in favor of isancestorrev()
martinvonz created this revision. Herald added a reviewer: indygreg. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY As agreed on by Boris, Yuya, and me on https://phab.mercurial-scm.org/D3929. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3934 AFFECTED FILES mercurial/context.py mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1645,21 +1645,6 @@ c.append(self.node(r)) return c -def isdescendantrev(self, a, b): -"""True if revision a is a descendant of revision b - -A revision is considered a descendant of itself. - -The implementation of this is trivial but the use of -commonancestorsheads is not.""" -if b == nullrev: -return True -elif a == b: -return True -elif a < b: -return False -return b in self._commonancestorsheads(a, b) - def commonancestorsheads(self, a, b): """calculate all the heads of the common ancestors of nodes a and b""" a, b = self.rev(a), self.rev(b) @@ -1684,8 +1669,17 @@ def isancestorrev(self, a, b): """return True if revision a is an ancestor of revision b -A revision is considered an ancestor of itself.""" -return self.isdescendantrev(b, a) +A revision is considered an ancestor of itself. + +The implementation of this is trivial but the use of +commonancestorsheads is not.""" +if a == nullrev: +return True +elif a == b: +return True +elif a > b: +return False +return a in self._commonancestorsheads(a, b) def ancestor(self, a, b): """calculate the "best" common ancestor of nodes a and b""" diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -591,7 +591,7 @@ def descendant(self, other): """True if other is descendant of this changeset""" -return self._repo.changelog.isdescendantrev(other._rev, self._rev) +return self._repo.changelog.isancestorrev(self._rev, other._rev) def walk(self, match): '''Generates matching file names.''' To: martinvonz, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3935: copies: delete now-unnecessary check for "a == b" before "a.descendant(b)"
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Unnecessary since https://phab.mercurial-scm.org/rHG879cbdde63df58af8579f018cd9210f7c83c622f (revlog: do inclusive descendant testing (API), 2018-06-21). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3935 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -416,14 +416,14 @@ # common ancestor or not without explicitly checking it, it's better to # determine that here. # -# base.descendant(wc) and base.descendant(base) are False, work around that +# base.descendant(wc) is False, work around that _c1 = c1.p1() if c1.rev() is None else c1 _c2 = c2.p1() if c2.rev() is None else c2 # an endpoint is "dirty" if it isn't a descendant of the merge base # if we have a dirty endpoint, we need to trigger graft logic, and also # keep track of which endpoint is dirty -dirtyc1 = not (base == _c1 or base.descendant(_c1)) -dirtyc2 = not (base == _c2 or base.descendant(_c2)) +dirtyc1 = not base.descendant(_c1) +dirtyc2 = not base.descendant(_c2) graft = dirtyc1 or dirtyc2 tca = base if graft: To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3929: revlog: replace descendant(b, a) by isdescendantrev(a, b) (API)
martinvonz added a comment. In https://phab.mercurial-scm.org/D3929#61325, @yuja wrote: > > This doesn't feels simpler, would it be possible to simply rename `descendant` into `isancestorrev` without changing the order of the arguments? > > While I've queued this without reading any comments (I hate junk mails > from Phabricator), I second the removal/deprecation of isdescendant*() > in favor of isancestor*(). That's fine with me. Kind of ironic since someone very recently went in the opposite direction and wrote isancestor() in terms of descendant() :) I'll send a patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3929 To: martinvonz, indygreg, #hg-reviewers Cc: yuja, lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3931: revlog: introduce a isancestorrev() and use it in rebase
martinvonz added a comment. In https://phab.mercurial-scm.org/D3931#61309, @lothiraldan wrote: > Having `isancestor` and `isancestorrev` taking the arguments in a different order seems confusing, I agree, but they're not in different order, are they? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3931 To: martinvonz, indygreg, #hg-reviewers Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 4] py3: use bytes() to byte-stringify Abort message in handleremotechangegroup()
# HG changeset patch # User Yuya Nishihara # Date 1531047155 -32400 # Sun Jul 08 19:52:35 2018 +0900 # Node ID ef9f6f9a5d37b9159b9e8b31749b57805c5811b3 # Parent e06128d929f7ae7bde69af75d6030e4a71db4fba py3: use bytes() to byte-stringify Abort message in handleremotechangegroup() diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -41,6 +41,7 @@ test-bundle2-exchange.t test-bundle2-format.t test-bundle2-multiple-changegroups.t test-bundle2-pushback.t +test-bundle2-remote-changegroup.t test-cappedreader.py test-casecollision.t test-cat.t diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1878,7 +1878,7 @@ def handleremotechangegroup(op, inpart): real_part.validate() except error.Abort as e: raise error.Abort(_('bundle at %s is corrupted:\n%s') % -(util.hidepassword(raw_url), str(e))) + (util.hidepassword(raw_url), bytes(e))) assert not inpart.read() @parthandler('reply:changegroup', ('return', 'in-reply-to')) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 4] py3: don't str() to byte-stringify object in test-bundle2-remote-changegroup.t
# HG changeset patch # User Yuya Nishihara # Date 1531046691 -32400 # Sun Jul 08 19:44:51 2018 +0900 # Node ID e06128d929f7ae7bde69af75d6030e4a71db4fba # Parent e934284b4390484eb576a1e9275bf7c97a758d04 py3: don't str() to byte-stringify object in test-bundle2-remote-changegroup.t diff --git a/tests/test-bundle2-remote-changegroup.t b/tests/test-bundle2-remote-changegroup.t --- a/tests/test-bundle2-remote-changegroup.t +++ b/tests/test-bundle2-remote-changegroup.t @@ -16,7 +16,14 @@ Create an extension to test bundle2 remo > Current bundle2 implementation doesn't provide a way to generate those > parts, so they must be created by extensions. > """ - > from mercurial import bundle2, changegroup, discovery, exchange, util + > from mercurial import ( + > bundle2, + > changegroup, + > discovery, + > exchange, + > pycompat, + > util, + > ) > > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, > b2caps=None, heads=None, common=None, @@ -60,13 +67,13 @@ Create an extension to test bundle2 remo >d = util.digester([digest], bundledata) >part = newpart(b'remote-changegroup') >part.addparam(b'url', url) - >part.addparam(b'size', str(len(bundledata))) + >part.addparam(b'size', b'%d' % len(bundledata)) >part.addparam(b'digests', digest) >part.addparam(b'digest:%s' % digest, d[digest]) > elif verb == b'raw-remote-changegroup': >part = newpart(b'remote-changegroup') >for k, v in eval(args).items(): - >part.addparam(k, str(v)) + >part.addparam(pycompat.sysbytes(k), pycompat.bytestr(v)) > elif verb == b'changegroup': > _common, heads = args.split() > common.extend(repo[r].node() for r in repo.revs(_common)) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 4] py3: byte-stringify literals in extension in test-bundle2-remote-changegroup.t
# HG changeset patch # User Yuya Nishihara # Date 1531046351 -32400 # Sun Jul 08 19:39:11 2018 +0900 # Node ID e934284b4390484eb576a1e9275bf7c97a758d04 # Parent fe6ac85bbf77ebebec9d0030549f7e1ae525f4b2 py3: byte-stringify literals in extension in test-bundle2-remote-changegroup.t # skip-blame just some b'' diff --git a/tests/test-bundle2-remote-changegroup.t b/tests/test-bundle2-remote-changegroup.t --- a/tests/test-bundle2-remote-changegroup.t +++ b/tests/test-bundle2-remote-changegroup.t @@ -40,45 +40,45 @@ Create an extension to test bundle2 remo > Python expression as parameters. The Python expression is > evaluated with eval, and is expected to be a dict. > """ - > def newpart(name, data=''): + > def newpart(name, data=b''): > """wrapper around bundler.newpart adding an extra part making the > client output information about each processed part""" - > bundler.newpart('output', data=name) + > bundler.newpart(b'output', data=name) > part = bundler.newpart(name, data=data) > return part > - > for line in open(repo.vfs.join('bundle2maker'), 'rb'): + > for line in open(repo.vfs.join(b'bundle2maker'), 'rb'): > line = line.strip() > try: > verb, args = line.split(None, 1) > except ValueError: - > verb, args = line, '' - > if verb == 'remote-changegroup': + > verb, args = line, b'' + > if verb == b'remote-changegroup': >url, file = args.split() >bundledata = open(file, 'rb').read() - >digest = util.digester.preferred(b2caps['digests']) + >digest = util.digester.preferred(b2caps[b'digests']) >d = util.digester([digest], bundledata) - >part = newpart('remote-changegroup') - >part.addparam('url', url) - >part.addparam('size', str(len(bundledata))) - >part.addparam('digests', digest) - >part.addparam('digest:%s' % digest, d[digest]) - > elif verb == 'raw-remote-changegroup': - >part = newpart('remote-changegroup') + >part = newpart(b'remote-changegroup') + >part.addparam(b'url', url) + >part.addparam(b'size', str(len(bundledata))) + >part.addparam(b'digests', digest) + >part.addparam(b'digest:%s' % digest, d[digest]) + > elif verb == b'raw-remote-changegroup': + >part = newpart(b'remote-changegroup') >for k, v in eval(args).items(): >part.addparam(k, str(v)) - > elif verb == 'changegroup': + > elif verb == b'changegroup': > _common, heads = args.split() > common.extend(repo[r].node() for r in repo.revs(_common)) > heads = [repo[r].node() for r in repo.revs(heads)] > outgoing = discovery.outgoing(repo, common, heads) - > cg = changegroup.makechangegroup(repo, outgoing, '01', - > 'changegroup') - > newpart('changegroup', cg.getchunks()) + > cg = changegroup.makechangegroup(repo, outgoing, b'01', + > b'changegroup') + > newpart(b'changegroup', cg.getchunks()) > else: > raise Exception('unknown verb') > - > exchange.getbundle2partsmapping['changegroup'] = _getbundlechangegrouppart + > exchange.getbundle2partsmapping[b'changegroup'] = _getbundlechangegrouppart > EOF Start a simple HTTP server to serve bundles ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 4] py3: open file in binary mode in test-bundle2-remote-changegroup.t
# HG changeset patch # User Yuya Nishihara # Date 1531046460 -32400 # Sun Jul 08 19:41:00 2018 +0900 # Node ID fe6ac85bbf77ebebec9d0030549f7e1ae525f4b2 # Parent 572dff5c946e05bc4743531803a5b79a6067f646 py3: open file in binary mode in test-bundle2-remote-changegroup.t diff --git a/tests/test-bundle2-remote-changegroup.t b/tests/test-bundle2-remote-changegroup.t --- a/tests/test-bundle2-remote-changegroup.t +++ b/tests/test-bundle2-remote-changegroup.t @@ -47,7 +47,7 @@ Create an extension to test bundle2 remo > part = bundler.newpart(name, data=data) > return part > - > for line in open(repo.vfs.join('bundle2maker'), 'r'): + > for line in open(repo.vfs.join('bundle2maker'), 'rb'): > line = line.strip() > try: > verb, args = line.split(None, 1) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3933: pullbundle: fix handling of gzip bundlespecs
joerg.sonnenberger created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3933 AFFECTED FILES mercurial/wireprotov1server.py tests/test-pull-bundle.t CHANGE DETAILS diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t --- a/tests/test-pull-bundle.t +++ b/tests/test-pull-bundle.t @@ -46,9 +46,9 @@ $ hg bundle --base 1 -r 2 .hg/2.hg 1 changesets found $ cat < .hg/pullbundles.manifest - > 2.hg heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa - > 1.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa - > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa + > 2.hg BUNDLESPEC=none-v2 heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa + > 1.hg BUNDLESPEC=bzip2-v2 heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa + > 0.hg BUNDLESPEC=gzip-v2 heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa > EOF $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) diff --git a/mercurial/wireprotov1server.py b/mercurial/wireprotov1server.py --- a/mercurial/wireprotov1server.py +++ b/mercurial/wireprotov1server.py @@ -353,7 +353,9 @@ common_anc = cl.ancestors([cl.rev(rev) for rev in common], inclusive=True) compformats = clientcompressionsupport(proto) for entry in res: -if 'COMPRESSION' in entry and entry['COMPRESSION'] not in compformats: +comp = entry.get('COMPRESSION') +altcomp = util.compengines._bundlenames.get(comp) +if comp and comp not in compformats and altcomp not in compformats: continue # No test yet for VERSION, since V2 is supported by any client # that advertises partial pulls 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
D3919: grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
yuja added a comment. > I think it would make sense to defer the behavior change until we test some more. That said, I do want us to plan to make an intentionally breaking change with the out of the box grep experience *without* `tweakdefaults` enabled. My reasoning is more or less this: approximately nobody uses `hg grep` today[0] because its behavior doesn't match what users expect out of the box. I'm willing to call the current behavior a *bug*, and prominently announce that with 4.8 we expect to change the default behavior of `hg grep` to match user expectations. That's in line with the decision outlined in [1] which is old enough that mpm was part of the decision. I strongly suspect hglib will be the only meaningful breakage, and we can patch hglib to pass the -r 0:tip flag that'll give consistent behavior across all hg versions. If we can take the current `hg grep` behavior as a bug, we can say the same thing for python-hglib. I don't want to make hglib grep diverged from hg one since hglib is a thin wrapper. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3919 To: yuja, #hg-reviewers, sangeet259, pulkit Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3919: grep: restore pre-9ef10437bb88 behavior, enable wdir search by tweakdefaults
> I think it would make sense to defer the behavior change until we test some > more. That said, I do want us to plan to make an intentionally breaking > change with the out of the box grep experience *without* `tweakdefaults` > enabled. My reasoning is more or less this: approximately nobody uses `hg > grep` today[0] because its behavior doesn't match what users expect out of > the box. I'm willing to call the current behavior a *bug*, and prominently > announce that with 4.8 we expect to change the default behavior of `hg grep` > to match user expectations. That's in line with the decision outlined in [1] > which is old enough that mpm was part of the decision. I strongly suspect > hglib will be the only meaningful breakage, and we can patch hglib to pass > the -r 0:tip flag that'll give consistent behavior across all hg versions. If we can take the current `hg grep` behavior as a bug, we can say the same thing for python-hglib. I don't want to make hglib grep diverged from hg one since hglib is a thin wrapper. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3929: revlog: replace descendant(b, a) by isdescendantrev(a, b) (API)
yuja added a comment. > This doesn't feels simpler, would it be possible to simply rename `descendant` into `isancestorrev` without changing the order of the arguments? While I've queued this without reading any comments (I hate junk mails from Phabricator), I second the removal/deprecation of isdescendant*() in favor of isancestor*(). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3929 To: martinvonz, indygreg, #hg-reviewers Cc: yuja, lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3929: revlog: replace descendant(b, a) by isdescendantrev(a, b) (API)
> This doesn't feels simpler, would it be possible to simply rename > `descendant` into `isancestorrev` without changing the order of the arguments? While I've queued this without reading any comments (I hate junk mails from Phabricator), I second the removal/deprecation of isdescendant*() in favor of isancestor*(). ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3870: rebase: add --confirm option
yuja added a comment. Queued, thanks. > - ui.status(_('starting dry-run rebase; repository will not be changed\n')) +confirm = opts.get('confirm') +if confirm: + ui.status(_('starting rebase...\n')) Nit: this message is misleading since nothing will be committed until accepting the changes. Can you remove it? Or alternatively, we can say that you're doing rebase in-memory so you're safe. > with repo.wlock(), repo.lock(): > try: > > +needsabort = True Moved this before the "try". > except error.InMemoryMergeConflictsError: > ui.status(_('hit a merge conflict\n')) > > +if confirm: > +# abort as in-memory merge doesn't support conflict > +rbsrt._prepareabortorcontinue(isabort=True, backup=False, > + suppwarns=True) > +needsabort = False > +if not ui.promptchoice(_(b'apply changes (yn)?' > + b'$$ $$ ')): Nit: This isn't actually "apply changes". > +_dorebase(ui, repo, opts, inmemory=False) `return _dorebase(...)` to not loose the actual result code. Can you fix by a follow-up patch? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3870 To: khanchi97, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3870: rebase: add --confirm option
Queued, thanks. > -ui.status(_('starting dry-run rebase; repository will not be changed\n')) > +confirm = opts.get('confirm') > +if confirm: > +ui.status(_('starting rebase...\n')) Nit: this message is misleading since nothing will be committed until accepting the changes. Can you remove it? Or alternatively, we can say that you're doing rebase in-memory so you're safe. > with repo.wlock(), repo.lock(): > try: > +needsabort = True Moved this before the "try". > except error.InMemoryMergeConflictsError: > ui.status(_('hit a merge conflict\n')) > +if confirm: > +# abort as in-memory merge doesn't support conflict > +rbsrt._prepareabortorcontinue(isabort=True, backup=False, > + suppwarns=True) > +needsabort = False > +if not ui.promptchoice(_(b'apply changes (yn)?' > + b'$$ $$ ')): Nit: This isn't actually "apply changes". > +_dorebase(ui, repo, opts, inmemory=False) `return _dorebase(...)` to not loose the actual result code. Can you fix by a follow-up patch? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3870: rebase: add --confirm option
This revision was automatically updated to reflect the committed changes. Closed by commit rHG572dff5c946e: rebase: add --confirm option (authored by khanchi97, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D3870?vs=9538=9568#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3870?vs=9538=9568 REVISION DETAIL https://phab.mercurial-scm.org/D3870 AFFECTED FILES hgext/rebase.py mercurial/cmdutil.py tests/test-rebase-inmemory.t CHANGE DETAILS diff --git a/tests/test-rebase-inmemory.t b/tests/test-rebase-inmemory.t --- a/tests/test-rebase-inmemory.t +++ b/tests/test-rebase-inmemory.t @@ -4,6 +4,7 @@ > amend= > rebase= > debugdrawdag=$TESTDIR/drawdag.py + > strip= > [rebase] > experimental.inmemory=1 > [diff] @@ -156,8 +157,8 @@ o 0: b173517d0057 'a' Test dry-run rebasing - $ hg init skrepo - $ cd skrepo + $ hg init repo3 + $ cd repo3 $ echo a>a $ hg ci -Aqma $ echo b>b @@ -323,3 +324,246 @@ merging e hit a merge conflict [1] + +== +Test for --confirm option| +== + $ cd .. + $ hg clone repo3 repo4 -q + $ cd repo4 + $ hg strip 7 -q + $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" + @ 6:baf10c5166d4 test + | g + | + o 5:6343ca3eff20 test + | f + | + | o 4:e860deea161a test + | | e + | | + | o 3:055a42cdd887 test + | | d + | | + | o 2:177f92b77385 test + |/ c + | + o 1:d2ae7f538514 test + | b + | + o 0:cb9a9f314b8b test + a + +Check it gives error when both --dryrun and --confirm is used: + $ hg rebase -s 2 -d . --confirm --dry-run + abort: cannot specify both --confirm and --dry-run + [255] + $ hg rebase -s 2 -d . --confirm --abort + abort: cannot specify both --confirm and --abort + [255] + $ hg rebase -s 2 -d . --confirm --continue + abort: cannot specify both --confirm and --continue + [255] + +Test --confirm option when there are no conflicts: + $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF + > n + > EOF + starting rebase... + rebasing 2:177f92b77385 "c" + rebasing 3:055a42cdd887 "d" + rebasing 4:e860deea161a "e" + rebase completed successfully + apply changes (yn)? n + $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" + @ 6:baf10c5166d4 test + | g + | + o 5:6343ca3eff20 test + | f + | + | o 4:e860deea161a test + | | e + | | + | o 3:055a42cdd887 test + | | d + | | + | o 2:177f92b77385 test + |/ c + | + o 1:d2ae7f538514 test + | b + | + o 0:cb9a9f314b8b test + a + + $ hg rebase -s 2 -d . --keep --config ui.interactive=True --confirm << EOF + > y + > EOF + starting rebase... + rebasing 2:177f92b77385 "c" + rebasing 3:055a42cdd887 "d" + rebasing 4:e860deea161a "e" + rebase completed successfully + apply changes (yn)? y + $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" + o 9:9fd28f55f6dc test + | e + | + o 8:12cbf031f469 test + | d + | + o 7:c83b1da5b1ae test + | c + | + @ 6:baf10c5166d4 test + | g + | + o 5:6343ca3eff20 test + | f + | + | o 4:e860deea161a test + | | e + | | + | o 3:055a42cdd887 test + | | d + | | + | o 2:177f92b77385 test + |/ c + | + o 1:d2ae7f538514 test + | b + | + o 0:cb9a9f314b8b test + a + +Test --confirm option when there is a conflict + $ hg up tip -q + $ echo ee>e + $ hg ci --amend -m "conflict with e" -q + $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" + @ 9:906d72f66a59 test + | conflict with e + | + o 8:12cbf031f469 test + | d + | + o 7:c83b1da5b1ae test + | c + | + o 6:baf10c5166d4 test + | g + | + o 5:6343ca3eff20 test + | f + | + | o 4:e860deea161a test + | | e + | | + | o 3:055a42cdd887 test + | | d + | | + | o 2:177f92b77385 test + |/ c + | + o 1:d2ae7f538514 test + | b + | + o 0:cb9a9f314b8b test + a + + $ hg rebase -s 4 -d . --keep --config ui.interactive=True --confirm << EOF + > n + > EOF + starting rebase... + rebasing 4:e860deea161a "e" + merging e + hit a merge conflict + apply changes (yn)? n + [1] + $ hg log -G --template "{rev}:{short(node)} {person(author)}\n{firstline(desc)} {topic}\n\n" + @ 9:906d72f66a59 test + | conflict with e + | + o 8:12cbf031f469 test + | d + | + o 7:c83b1da5b1ae test + | c + | + o 6:baf10c5166d4 test + | g + | + o 5:6343ca3eff20 test + | f + | + | o 4:e860deea161a test + | | e + | | + | o 3:055a42cdd887 test + | | d + | | + | o 2:177f92b77385 test + |/ c + | + o 1:d2ae7f538514 test + | b + | + o 0:cb9a9f314b8b test + a + + + $ hg rebase -s 4 -d . --keep --config ui.interactive=True --confirm << EOF + > y + > EOF + starting rebase... + rebasing 4:e860deea161a "e" +
D3929: revlog: replace descendant(b, a) by isdescendantrev(a, b) (API)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG160da69ba1bf: revlog: replace descendant(b, a) by isdescendantrev(a, b) (API) (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3929?vs=9559=9565 REVISION DETAIL https://phab.mercurial-scm.org/D3929 AFFECTED FILES mercurial/context.py mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1645,18 +1645,18 @@ c.append(self.node(r)) return c -def descendant(self, start, end): -"""True if revision 'end' is an descendant of revision 'start' - -A revision is considered as a descendant of itself. +def isdescendantrev(self, a, b): +"""True if revision a is a descendant of revision b + +A revision is considered a descendant of itself. The implementation of this is trivial but the use of commonancestorsheads is not.""" -if start == nullrev: +if b == nullrev: return True -elif start == end: +elif a == b: return True -return start in self._commonancestorsheads(start, end) +return b in self._commonancestorsheads(a, b) def commonancestorsheads(self, a, b): """calculate all the heads of the common ancestors of nodes a and b""" @@ -1673,9 +1673,11 @@ return ancs def isancestor(self, a, b): -"""return True if node a is an ancestor of node b""" +"""return True if node a is an ancestor of node b + +A revision is considered an ancestor of itself.""" a, b = self.rev(a), self.rev(b) -return self.descendant(a, b) +return self.isdescendantrev(b, a) def ancestor(self, a, b): """calculate the "best" common ancestor of nodes a and b""" diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -591,7 +591,7 @@ def descendant(self, other): """True if other is descendant of this changeset""" -return self._repo.changelog.descendant(self._rev, other._rev) +return self._repo.changelog.isdescendantrev(other._rev, self._rev) def walk(self, match): '''Generates matching file names.''' To: martinvonz, indygreg, #hg-reviewers Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3931: revlog: introduce a isancestorrev() and use it in rebase
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa06b2b032557: revlog: introduce a isancestorrev() and use it in rebase (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3931?vs=9561=9567 REVISION DETAIL https://phab.mercurial-scm.org/D3931 AFFECTED FILES hgext/rebase.py mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1679,6 +1679,12 @@ A revision is considered an ancestor of itself.""" a, b = self.rev(a), self.rev(b) +return self.isancestorrev(a, b) + +def isancestorrev(self, a, b): +"""return True if revision a is an ancestor of revision b + +A revision is considered an ancestor of itself.""" return self.isdescendantrev(b, a) def ancestor(self, a, b): diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -1291,13 +1291,7 @@ # use unfiltered changelog since successorrevs may return filtered nodes assert repo.filtername is None cl = repo.changelog -def isancestor(a, b): -# take revision numbers instead of nodes -if a == b: -return True -elif a > b: -return False -return cl.isancestor(cl.node(a), cl.node(b)) +isancestor = cl.isancestorrev dest = destmap[rev] oldps = repo.changelog.parentrevs(rev) # old parents To: martinvonz, indygreg, #hg-reviewers Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3930: revlog: make isdescendantrev(a, b) check if a < b
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6afa928033bd: revlog: make isdescendantrev(a, b) check if a b (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3930?vs=9560=9566 REVISION DETAIL https://phab.mercurial-scm.org/D3930 AFFECTED FILES mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1656,6 +1656,8 @@ return True elif a == b: return True +elif a < b: +return False return b in self._commonancestorsheads(a, b) def commonancestorsheads(self, a, b): To: martinvonz, indygreg, #hg-reviewers, lothiraldan Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3928: revlog: move comment about commonancestorsheads where it's used
This revision was automatically updated to reflect the committed changes. Closed by commit rHG93d9690ff2b0: revlog: move comment about commonancestorsheads where its used (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3928?vs=9558=9564 REVISION DETAIL https://phab.mercurial-scm.org/D3928 AFFECTED FILES mercurial/revlog.py CHANGE DETAILS diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1648,7 +1648,10 @@ def descendant(self, start, end): """True if revision 'end' is an descendant of revision 'start' -A revision is considered as a descendant of itself.""" +A revision is considered as a descendant of itself. + +The implementation of this is trivial but the use of +commonancestorsheads is not.""" if start == nullrev: return True elif start == end: @@ -1670,10 +1673,7 @@ return ancs def isancestor(self, a, b): -"""return True if node a is an ancestor of node b - -The implementation of this is trivial but the use of -commonancestorsheads is not.""" +"""return True if node a is an ancestor of node b""" a, b = self.rev(a), self.rev(b) return self.descendant(a, b) To: martinvonz, indygreg, #hg-reviewers, lothiraldan Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3927: removeemptydirs: add test for `hg split` inside a disappearing directory
This revision was automatically updated to reflect the committed changes. Closed by commit rHGad2aa4e85047: removeemptydirs: add test for `hg split` inside a disappearing directory (authored by spectral, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3927?vs=9557=9563 REVISION DETAIL https://phab.mercurial-scm.org/D3927 AFFECTED FILES tests/test-removeemptydirs.t CHANGE DETAILS diff --git a/tests/test-removeemptydirs.t b/tests/test-removeemptydirs.t --- a/tests/test-removeemptydirs.t +++ b/tests/test-removeemptydirs.t @@ -149,7 +149,8 @@ $ hg init issue5826_withrm $ cd issue5826_withrm - $ cat >> $HGRCPATH <> .hg/hgrc < [extensions] > histedit = > EOF @@ -199,7 +200,8 @@ $ hg init issue5826_norm $ cd issue5826_norm - $ cat >> $HGRCPATH <> .hg/hgrc < [extensions] > histedit = > [experimental] @@ -240,3 +242,89 @@ *** add baz 0:d17db4b0303a add bar + + $ cd $TESTTMP + +Testing `hg split` being run from inside of a directory that was created in the +commit being split: + + $ hg init hgsplit + $ cd hgsplit + $ cat >> .hg/hgrc << EOF + > [ui] + > interactive = 1 + > [extensions] + > split = + > EOF + $ echo anchor > anchor.txt + $ hg ci -qAm anchor + +Create a changeset with '/otherfile_in_root' and 'somedir/foo', then try to +split it. + $ echo otherfile > otherfile_in_root + $ mkdir somedir + $ cd somedir + $ echo hi > foo + $ hg ci -qAm split_me +(Note: need to make this file not in this directory, or else the bug doesn't +reproduce; we're using a separate file due to concerns of portability on +`echo -e`) + $ cat > ../split_commands << EOF + > n + > y + > y + > a + > EOF + $ cat ../split_commands | hg split + current directory was removed + (consider changing to repo root: $TESTTMP/hgsplit) + diff --git a/otherfile_in_root b/otherfile_in_root + new file mode 100644 + examine changes to 'otherfile_in_root'? [Ynesfdaq?] n + + diff --git a/somedir/foo b/somedir/foo + new file mode 100644 + examine changes to 'somedir/foo'? [Ynesfdaq?] y + + @@ -0,0 +1,1 @@ + +hi + record change 2/2 to 'somedir/foo'? [Ynesfdaq?] y + + abort: $ENOENT$ + [255] + +Let's try that again without the rmdir + $ cd $TESTTMP/hgsplit/somedir +Show that the previous split didn't do anything + $ hg log -T '{rev}:{node|short} {desc}\n' + 1:e26b22a4f0b7 split_me + 0:7e53273730c0 anchor + $ hg status + ? split_commands +Try again + $ cat ../split_commands | hg $NO_RM split + diff --git a/otherfile_in_root b/otherfile_in_root + new file mode 100644 + examine changes to 'otherfile_in_root'? [Ynesfdaq?] n + + diff --git a/somedir/foo b/somedir/foo + new file mode 100644 + examine changes to 'somedir/foo'? [Ynesfdaq?] y + + @@ -0,0 +1,1 @@ + +hi + record change 2/2 to 'somedir/foo'? [Ynesfdaq?] y + + created new head + diff --git a/otherfile_in_root b/otherfile_in_root + new file mode 100644 + examine changes to 'otherfile_in_root'? [Ynesfdaq?] a + + saved backup bundle to $TESTTMP/hgsplit/.hg/strip-backup/*-split.hg (glob) +Show that this split did something + $ hg log -T '{rev}:{node|short} {desc}\n' + 2:a440f24fca4f split_me + 1:c994f20276ab split_me + 0:7e53273730c0 anchor + $ hg status + ? split_commands To: spectral, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] diff: graduate word-diff option from experimental
On Thu, 12 Jul 2018 12:22:31 +0800, Anton Shestakov wrote: > On Wed, 11 Jul 2018 23:08:37 +0530 > Pulkit Goyal <7895pul...@gmail.com> wrote: > > > On Mon, Jul 9, 2018 at 6:29 PM Yuya Nishihara wrote: > > > > > On Sun, 8 Jul 2018 18:29:37 +0530, Pulkit Goyal wrote: > > > > > --- a/mercurial/help/config.txt > > > > > +++ b/mercurial/help/config.txt > > > > > @@ -702,6 +702,9 @@ for related options for the annotate com > > > > > ``unified`` > > > > > Number of lines of context to show. > > > > > > > > > > +``word-diff`` > > > > > +Highlight changed words. > > > > > + > > > > > > > > > > > > > TBH, I am not fan of documenting config options in `hg help config`. > > > > Rather we should document this in commands' help text where it is > > > > applicable so that this is more discoverable. > > `hg help diff` actually sort of does document useful diff options... > just because they are also command-line options, such as: > > -g --git use git extended diff format > -p --show-function show which function each change is in > -w --ignore-all-spaceignore white space when comparing lines > -b --ignore-space-change ignore changes in the amount of white space > -B --ignore-blank-lines ignore changes whose lines are all blank > -U --unified NUM number of lines of context to show > > They are all configurable in .hgrc. > > (Should we have --word-diff option too now that it's not experimental?) That's tempting, but I'm not certain whether --word-diff should take a mode like git. > > > I agree that it's nice if each command help includes reference to related > > > configs, but I think 'help config' should be the canonical source of all > > > supported options. Otherwise we would have to grep all command helps to > > > find a meaning of a certain config option. > > > > > > > Can't we have the documentation at both places? I don't think that's > > harmful. > > But blowing up line count of hg help is harmful, and that would happen > if we told .hgrc equivalent for each and every command-line option > right on the spot. Instead, how about something like "most of these > options exist as configuration file options, see hg help config.diff"? > I couldn't find any other `hg help cmd` that refers to `hg help > config.cmd` as of yet, but it's probably because other commands don't > have their own .hgrc section. Alternatively, the config section in "help " could be gated by --verbose. I'm okay to add such section as long as the help text isn't literally duplicated in codebase. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V2] patch: don't separate \r and \n when colorizing diff output
On Wed, 11 Jul 2018 23:33:16 +0200, Sune Foldager wrote: > >> Hm what’s wrong with -i? At any rate, I don’t have time to do this today. > > > > -i was added with different behaviors on BSD and GNU sed. It's incompatible > > between those seds. > > Right, although it seems plain -i would work identically on both BSD and GNU, > at least from reading the man pages on macOS and Linux. They both edit > in-place, but the GNU version can take an optional argument after -i, for > backup. Anyway, I changed the patch. 'sed -i' didn't work on FreeBSD 10. macOS userland isn't pretty much a BSD. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] fncache: avoid loading the filename cache when not actually modifying it
On Wed, 11 Jul 2018 14:37:26 +0100, Martijn Pieters wrote: > # HG changeset patch > # User Martijn Pieters > # Date 1531315693 -3600 > # Wed Jul 11 14:28:13 2018 +0100 > # Node ID 39bc6540388e79da1a670fcd382aa77b8aa27224 > # Parent 4d5fb4062f0bb159230062701461fa6cab9b539b > # EXP-Topic fncache_prevent_load_when_exists > fncache: avoid loading the filename cache when not actually modifying it Looks good. Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V2] tests: add diff color trailing whitespace test
On Wed, 11 Jul 2018 23:40:32 +0200, Sune Foldager via Mercurial-devel wrote: > # HG changeset patch > # User Sune Foldager > # Date 1531318293 -7200 > # Wed Jul 11 16:11:33 2018 +0200 > # Node ID 95fc4453e33a79acca36f978019a05ff9f4ae04a > # Parent 4d5fb4062f0bb159230062701461fa6cab9b539b > tests: add diff color trailing whitespace test Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3931: revlog: introduce a isancestorrev() and use it in rebase
lothiraldan added a comment. Having `isancestor` and `isancestorrev` taking the arguments in a different order seems confusing, REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3931 To: martinvonz, indygreg, #hg-reviewers Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3929: revlog: replace descendant(b, a) by isdescendantrev(a, b) (API)
lothiraldan added a comment. This doesn't feels simpler, would it be possible to simply rename `descendant` into `isancestorrev` without changing the order of the arguments? Also it would be useful for extensions to have a deprecation warning at least for 1 cycle? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3929 To: martinvonz, indygreg, #hg-reviewers Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3930: revlog: make isdescendantrev(a, b) check if a < b
lothiraldan accepted this revision. lothiraldan added a comment. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3930 To: martinvonz, indygreg, #hg-reviewers, lothiraldan Cc: lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@38615: new changeset (1 on stable)
New changeset (1 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/443029011990 changeset: 38615:443029011990 branch: stable tag: tip parent: 38533:3a0f322af192 user:Yuya Nishihara date:Sun Jul 01 23:36:53 2018 +0900 summary: encoding: alias cp65001 to utf-8 on Windows -- 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