[PATCH 1 of 2] tests: check obsolete changeset with two obsfate entries
# HG changeset patch # User Anton Shestakov# Date 1519014623 -28800 # Mon Feb 19 12:30:23 2018 +0800 # Node ID 29f9eeec6782d2815cf742d22286b0192fc3c14a # Parent b76b0297c3738e8f114202c50cb6f804425f0853 tests: check obsolete changeset with two obsfate entries It's more interesting to see how a changeset that was both rewritten and split looks in hgweb. diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t --- a/tests/test-obsolete-divergent.t +++ b/tests/test-obsolete-divergent.t @@ -621,6 +621,29 @@ fix the divergence a139f71be9da $ hg log -r 'contentdivergent()' +#if serve + + $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid --config web.view=all \ + > -A access.log -E errors.log + $ cat hg.pid >> $DAEMON_PIDS + +check an obsolete changeset that was rewritten and also split + + $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=paper' | egrep 'rewritten|split' + rewritten as bed64f5d2f5a by Thu, 01 Jan 1970 00:00:00 +split as 7ae126973a96 14608b260df8 by Thu, 01 Jan 1970 00:00:00 + + $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=coal' | egrep 'rewritten|split' + rewritten as bed64f5d2f5a by Thu, 01 Jan 1970 00:00:00 +split as 7ae126973a96 14608b260df8 by Thu, 01 Jan 1970 00:00:00 + + $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=gitweb' | egrep 'rewritten|split' + obsoleterewritten as bed64f5d2f5a by Thu, 01 Jan 1970 00:00:00 +split as 7ae126973a96 14608b260df8 by Thu, 01 Jan 1970 00:00:00 + + $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=monoblue' | egrep 'rewritten|split' + obsoleterewritten as bed64f5d2f5a by Thu, 01 Jan 1970 00:00:00 +split as 7ae126973a96 14608b260df8 by Thu, 01 Jan 1970 00:00:00 + + $ get-with-headers.py localhost:$HGPORT 'rev/e442cfc57690?style=spartan' | egrep 'rewritten|split' + rewritten as bed64f5d2f5a by Thu, 01 Jan 1970 00:00:00 +split as 7ae126973a96 14608b260df8 by Thu, 01 Jan 1970 00:00:00 + + + $ killdaemons.py + +#endif + $ cd .. diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -1052,18 +1052,6 @@ check obsolete changeset obsolete: pruned by Thu, 01 Jan 1970 00:00:00 + -check an obsolete changeset that has been rewritten - $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=paper' | grep rewritten - rewritten as 3de5eca88c00 by Thu, 01 Jan 1970 00:00:00 + - $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=coal' | grep rewritten - rewritten as 3de5eca88c00 by Thu, 01 Jan 1970 00:00:00 + - $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=gitweb' | grep rewritten - obsoleterewritten as 3de5eca88c00 by Thu, 01 Jan 1970 00:00:00 + - $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=monoblue' | grep rewritten - obsoleterewritten as 3de5eca88c00 by Thu, 01 Jan 1970 00:00:00 + - $ get-with-headers.py localhost:$HGPORT 'rev/cda648ca50f5?style=spartan' | grep rewritten - rewritten as 3de5eca88c00 by Thu, 01 Jan 1970 00:00:00 + - check changeset with instabilities $ get-with-headers.py localhost:$HGPORT 'log?rev=first(phasedivergent())=paper' | grep '' ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 2] hgweb: show each obsfateentry on its own line
# HG changeset patch # User Anton Shestakov# Date 1519015730 -28800 # Mon Feb 19 12:48:50 2018 +0800 # Node ID 68315c9df7c97acbb62a0a8bb23412e68eb67947 # Parent 29f9eeec6782d2815cf742d22286b0192fc3c14a hgweb: show each obsfateentry on its own line Commits with more than one reason for being obsolete used to just show obsfate entries all on one line, and that doesn't look good. Let's show each entry on its own line. In paper and coal the lines are simply split using a element, and in other hgweb themes each entry has its own table header. This is done by analogy with changeset parents and children -- in paper and coal they are all put into one table row, and everywhere else each one gets a separate row. diff --git a/mercurial/templates/gitweb/changeset.tmpl b/mercurial/templates/gitweb/changeset.tmpl --- a/mercurial/templates/gitweb/changeset.tmpl +++ b/mercurial/templates/gitweb/changeset.tmpl @@ -44,7 +44,7 @@ changeset | changeset {rev} {node|short} -{if(obsolete, 'obsolete{succsandmarkers%obsfateentry}')} +{if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} {child%changesetchild} diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map +++ b/mercurial/templates/gitweb/map @@ -277,7 +277,11 @@ obsfateverb = '{obsfateverb(successors, obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' +obsfateentry = ' + +obsolete + {obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate} + ' shortlogentry = ' {date|rfc822date} diff --git a/mercurial/templates/monoblue/changeset.tmpl b/mercurial/templates/monoblue/changeset.tmpl --- a/mercurial/templates/monoblue/changeset.tmpl +++ b/mercurial/templates/monoblue/changeset.tmpl @@ -48,7 +48,7 @@ {branch%changesetbranch} changeset {rev} {node|short} -{if(obsolete, 'obsolete{succsandmarkers%obsfateentry}')} +{if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(parent), '2', parent%changesetparentdiff, parent%changesetparent)} {child%changesetchild} diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map +++ b/mercurial/templates/monoblue/map @@ -235,7 +235,9 @@ obsfateverb = '{obsfateverb(successors, obsfateoperations = '{if(obsfateoperations(markers), ' using {join(obsfateoperations(markers), ', ')}')}' obsfateusers = '{if(obsfateusers(markers), ' by {join(obsfateusers(markers)%'{user|obfuscate}', ', ')}')}' obsfatedate = '{if(obsfatedate(markers), ' {ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), '{min(obsfatedate(markers))|rfc822date}', 'between {min(obsfatedate(markers))|rfc822date} and {max(obsfatedate(markers))|rfc822date}')}')}' -obsfateentry = '{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' +obsfateentry = ' + obsolete + {obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}' shortlogentry = ' {date|rfc822date} diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl --- a/mercurial/templates/paper/changeset.tmpl +++ b/mercurial/templates/paper/changeset.tmpl @@ -51,7 +51,7 @@ {if(obsolete, ' obsolete - {succsandmarkers%obsfateentry} + {join(succsandmarkers%obsfateentry, '\n')} ')} parents diff --git a/mercurial/templates/spartan/changelogentry.tmpl b/mercurial/templates/spartan/changelogentry.tmpl --- a/mercurial/templates/spartan/changelogentry.tmpl +++ b/mercurial/templates/spartan/changelogentry.tmpl @@ -22,10 +22,7 @@ phase: {phase|escape} ')} - {if(obsolete, ' - obsolete: - {succsandmarkers%obsfateentry} - ')} + {if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(instabilities), '0', '', ' instabilities: {instabilities%"{instability} "|escape} diff --git a/mercurial/templates/spartan/changeset.tmpl b/mercurial/templates/spartan/changeset.tmpl --- a/mercurial/templates/spartan/changeset.tmpl +++ b/mercurial/templates/spartan/changeset.tmpl @@ -37,10 +37,7 @@ phase: {phase|escape} ')} -{if(obsolete, ' - obsolete: - {succsandmarkers%obsfateentry} -')} +{if(obsolete, succsandmarkers%obsfateentry)} {ifeq(count(instabilities), '0', '', ' instabilities: {instabilities%"{instability} "|escape} diff --git a/mercurial/templates/spartan/map
D2343: largefiles: give some **opts some strkwargs love
This revision was automatically updated to reflect the committed changes. Closed by commit rHGac2717966335: largefiles: give some **opts some strkwargs love (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2343?vs=5900=5911 REVISION DETAIL https://phab.mercurial-scm.org/D2343 AFFECTED FILES hgext/largefiles/overrides.py CHANGE DETAILS diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1238,10 +1238,11 @@ matchfn = m.matchfn m.matchfn = lambda f: f in s.deleted and matchfn(f) -removelargefiles(repo.ui, repo, True, m, **opts) +removelargefiles(repo.ui, repo, True, m, **pycompat.strkwargs(opts)) # Call into the normal add code, and any files that *should* be added as # largefiles will be -added, bad = addlargefiles(repo.ui, repo, True, matcher, **opts) +added, bad = addlargefiles(repo.ui, repo, True, matcher, + **pycompat.strkwargs(opts)) # Now that we've handled largefiles, hand off to the original addremove # function to take care of the rest. Make sure it doesn't do anything with # largefiles by passing a matcher that will ignore them. To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2347: lock: delay is numeric, use %d for formatting
This revision was automatically updated to reflect the committed changes. Closed by commit rHGefbba1e4dfba: lock: delay is numeric, use %d for formatting (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2347?vs=5904=5915 REVISION DETAIL https://phab.mercurial-scm.org/D2347 AFFECTED FILES mercurial/lock.py CHANGE DETAILS diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -84,9 +84,9 @@ l.delay = delay if l.delay: if 0 <= warningidx <= l.delay: -ui.warn(_("got lock after %s seconds\n") % l.delay) +ui.warn(_("got lock after %d seconds\n") % l.delay) else: -ui.debug("got lock after %s seconds\n" % l.delay) +ui.debug("got lock after %d seconds\n" % l.delay) if l.acquirefn: l.acquirefn() return l To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2348: py3: whitelist another six passing tests
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb76b0297c373: py3: whitelist another six passing tests (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2348?vs=5905=5916 REVISION DETAIL https://phab.mercurial-scm.org/D2348 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -27,6 +27,7 @@ test-check-pylint.t test-check-shbang.t test-children.t +test-clone-pull-corruption.t test-clone-r.t test-clone-update-order.t test-commit-unresolved.t @@ -37,6 +38,7 @@ test-convert-clonebranches.t test-copy-move-merge.t test-copytrace-heuristics.t +test-debugbuilddag.t test-debugindexdot.t test-debugrename.t test-diff-binary-file.t @@ -110,6 +112,7 @@ test-histedit-outgoing.t test-http-branchmap.t test-http-clone-r.t +test-identify.t test-imports-checker.t test-inherit-mode.t test-issue1089.t @@ -120,6 +123,7 @@ test-issue1802.t test-issue1877.t test-issue1993.t +test-issue3084.t test-issue4074.t test-issue522.t test-issue586.t @@ -169,6 +173,7 @@ test-pull-branch.t test-pull-http.t test-pull-permission.t +test-pull-pull-corruption.t test-push-checkheads-partial-C1.t test-push-checkheads-partial-C2.t test-push-checkheads-partial-C3.t @@ -217,6 +222,7 @@ test-rename-merge1.t test-rename.t test-repair-strip.t +test-repo-compengines.t test-revert-flags.t test-revert-unknown.t test-revlog-group-emptyiter.t To: durin42, pulkit, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2345: tests: add missing b prefixes in test-pending.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG53bfd25bb9dd: tests: add missing b prefixes in test-pending.t (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2345?vs=5902=5913 REVISION DETAIL https://phab.mercurial-scm.org/D2345 AFFECTED FILES tests/test-pending.t CHANGE DETAILS diff --git a/tests/test-pending.t b/tests/test-pending.t --- a/tests/test-pending.t +++ b/tests/test-pending.t @@ -44,7 +44,7 @@ > import os, time > from mercurial import ui, localrepo > def rejecthook(ui, repo, hooktype, node, **opts): - > ui.write('hook %s\\n' % repo['tip'].hex()) + > ui.write(b'hook %s\\n' % repo[b'tip'].hex()) > # create the notify file so caller knows we're running > fpath = os.path.join('$d', 'notify') > f = open(fpath, 'w') To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2344: merge: make a copy of dict.items() before mutating the dict during iteration
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc44c5ecc2565: merge: make a copy of dict.items() before mutating the dict during iteration (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2344?vs=5901=5912 REVISION DETAIL https://phab.mercurial-scm.org/D2344 AFFECTED FILES mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1185,8 +1185,9 @@ def _resolvetrivial(repo, wctx, mctx, ancestor, actions): """Resolves false conflicts where the nodeid changed but the content remained the same.""" - -for f, (m, args, msg) in actions.items(): +# We force a copy of actions.items() because we're going to mutate +# actions as we resolve trivial conflicts. +for f, (m, args, msg) in list(actions.items()): if m == 'cd' and f in ancestor and not wctx[f].cmp(ancestor[f]): # local did change but ended up with same content actions[f] = 'r', None, "prompt same" To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2346: debugbuilddag: use '%d' instead of str() to get numbered lines
This revision was automatically updated to reflect the committed changes. Closed by commit rHG7c5be6de4cb0: debugbuilddag: use %d instead of str() to get numbered lines (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2346?vs=5903=5914 REVISION DETAIL https://phab.mercurial-scm.org/D2346 AFFECTED FILES mercurial/debugcommands.py CHANGE DETAILS diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -163,7 +163,7 @@ if mergeable_file: linesperrev = 2 # make a file with k lines per rev -initialmergedlines = [str(i) for i in xrange(0, total * linesperrev)] +initialmergedlines = ['%d' % i for i in xrange(0, total * linesperrev)] initialmergedlines.append("") tags = [] To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2338: largefiles: make scheme regex a bytes regex
This revision was automatically updated to reflect the committed changes. Closed by commit rHGf3754b60f93d: largefiles: make scheme regex a bytes regex (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2338?vs=5895=5906 REVISION DETAIL https://phab.mercurial-scm.org/D2338 AFFECTED FILES hgext/largefiles/storefactory.py CHANGE DETAILS diff --git a/hgext/largefiles/storefactory.py b/hgext/largefiles/storefactory.py --- a/hgext/largefiles/storefactory.py +++ b/hgext/largefiles/storefactory.py @@ -80,7 +80,7 @@ 'ssh': [wirestore.wirestore], } -_scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://') +_scheme_re = re.compile(br'^([a-zA-Z0-9+-.]+)://') def getlfile(ui, hash): return util.chunkbuffer(openstore(ui=ui)._get(hash)) To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2339: largfiles: replace filter() with listcomp when result needs to be a list
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa74243227aec: largfiles: replace filter() with listcomp when result needs to be a list (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2339?vs=5896=5907 REVISION DETAIL https://phab.mercurial-scm.org/D2339 AFFECTED FILES hgext/largefiles/lfcommands.py hgext/largefiles/overrides.py CHANGE DETAILS diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -42,7 +42,7 @@ matcher''' m = copy.copy(match) lfile = lambda f: lfutil.standin(f) in manifest -m._files = filter(lfile, m._files) +m._files = [lf for lf in m._files if lfile(lf)] m._fileset = set(m._files) m.always = lambda: False origmatchfn = m.matchfn @@ -57,7 +57,7 @@ m = copy.copy(match) notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in manifest or f in excluded) -m._files = filter(notlfile, m._files) +m._files = [lf for lf in m._files if notlfile(lf)] m._fileset = set(m._files) m.always = lambda: False origmatchfn = m.matchfn diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -365,7 +365,7 @@ at = 0 ui.debug("sending statlfile command for %d largefiles\n" % len(files)) retval = store.exists(files) -files = filter(lambda h: not retval[h], files) +files = [h for h in files if not retval[h]] ui.debug("%d largefiles need to be uploaded\n" % len(files)) for hash in files: To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2342: wireproto: fix lingering str(exception) with util.forcebytestr(exception)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG803fca7fa088: wireproto: fix lingering str(exception) with util.forcebytestr(exception) (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2342?vs=5899=5910 REVISION DETAIL https://phab.mercurial-scm.org/D2342 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -927,7 +927,7 @@ r = c.hex() success = 1 except Exception as inst: -r = str(inst) +r = util.forcebytestr(inst) success = 0 return bytesresponse('%d %s\n' % (success, r)) @@ -1055,12 +1055,13 @@ if exc.params: errpart.addparam('params', '\0'.join(exc.params)) except error.Abort as exc: -manargs = [('message', str(exc))] +manargs = [('message', util.forcebytestr(exc))] advargs = [] if exc.hint is not None: advargs.append(('hint', exc.hint)) bundler.addpart(bundle2.bundlepart('error:abort', manargs, advargs)) except error.PushRaced as exc: -bundler.newpart('error:pushraced', [('message', str(exc))]) +bundler.newpart('error:pushraced', +[('message', util.forcebytestr(exc))]) return streamres_legacy(gen=bundler.getchunks()) To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2340: largefiles: mark headre as bytes regex
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9d16c0789dfb: largefiles: mark headre as bytes regex (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2340?vs=5897=5908 REVISION DETAIL https://phab.mercurial-scm.org/D2340 AFFECTED FILES hgext/largefiles/proto.py CHANGE DETAILS diff --git a/hgext/largefiles/proto.py b/hgext/largefiles/proto.py --- a/hgext/largefiles/proto.py +++ b/hgext/largefiles/proto.py @@ -180,7 +180,7 @@ args[r'cmds'] = args[r'cmds'].replace('heads ', 'lheads ') return ssholdcallstream(self, cmd, **args) -headsre = re.compile(r'(^|;)heads\b') +headsre = re.compile(br'(^|;)heads\b') def httprepocallstream(self, cmd, **args): if cmd == 'heads' and self.capable('largefiles'): To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2341: scmutil: fix requires-file isalnum() check on first byte
This revision was automatically updated to reflect the committed changes. Closed by commit rHGcd15577f5bee: scmutil: fix requires-file isalnum() check on first byte (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2341?vs=5898=5909 REVISION DETAIL https://phab.mercurial-scm.org/D2341 AFFECTED FILES mercurial/scmutil.py CHANGE DETAILS diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -887,7 +887,7 @@ missings = [] for r in requirements: if r not in supported: -if not r or not r[0].isalnum(): +if not r or not r[0:1].isalnum(): raise error.RequirementError(_(".hg/requires file is corrupt")) missings.append(r) missings.sort() To: durin42, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] debuginstall: do not parse editor command in posix way on Windows
On Sat, Feb 17, 2018 at 01:33:38PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1518840784 -32400 > # Sat Feb 17 13:13:04 2018 +0900 > # Node ID b42f9a63030fee00568add7aa5a5ff983fbcd06d > # Parent c9f30dcc3f43793088c99c3acef7db12857cc2cc > debuginstall: do not parse editor command in posix way on Windows queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 4 STABLE] tests: expand test coverage for updating phases
On Sun, Feb 18, 2018 at 10:23:07AM -0800, Gregory Szorc wrote: > # HG changeset patch > # User Gregory Szorc> # Date 1518978019 28800 > # Sun Feb 18 10:20:19 2018 -0800 > # Branch stable > # Node ID 337491de32e3e273c7b98a5259bd053f44acdede > # Parent ec71cddd8b6915f7fa2029c641a8385bef1392c3 > tests: expand test coverage for updating phases queued for stable, reasoning seems sound, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 2] py3: use bytes() to byte-stringify url object in url.py
On Sun, Feb 18, 2018 at 10:55:10PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1518959605 -32400 > # Sun Feb 18 22:13:25 2018 +0900 > # Node ID b7ebed58e716806e5789779090bc054e98fb43e2 > # Parent 20fd00ae43f25ab4db11bafc909a6a659bb74cbe > py3: use bytes() to byte-stringify url object in url.py queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2343: largefiles: give some **opts some strkwargs love
durin42 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/D2343 AFFECTED FILES hgext/largefiles/overrides.py CHANGE DETAILS diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1238,10 +1238,11 @@ matchfn = m.matchfn m.matchfn = lambda f: f in s.deleted and matchfn(f) -removelargefiles(repo.ui, repo, True, m, **opts) +removelargefiles(repo.ui, repo, True, m, **pycompat.strkwargs(opts)) # Call into the normal add code, and any files that *should* be added as # largefiles will be -added, bad = addlargefiles(repo.ui, repo, True, matcher, **opts) +added, bad = addlargefiles(repo.ui, repo, True, matcher, + **pycompat.strkwargs(opts)) # Now that we've handled largefiles, hand off to the original addremove # function to take care of the rest. Make sure it doesn't do anything with # largefiles by passing a matcher that will ignore them. To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2346: debugbuilddag: use '%d' instead of str() to get numbered lines
durin42 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/D2346 AFFECTED FILES mercurial/debugcommands.py CHANGE DETAILS diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -163,7 +163,7 @@ if mergeable_file: linesperrev = 2 # make a file with k lines per rev -initialmergedlines = [str(i) for i in xrange(0, total * linesperrev)] +initialmergedlines = ['%d' % i for i in xrange(0, total * linesperrev)] initialmergedlines.append("") tags = [] To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2345: tests: add missing b prefixes in test-pending.t
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame more b prefixes REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2345 AFFECTED FILES tests/test-pending.t CHANGE DETAILS diff --git a/tests/test-pending.t b/tests/test-pending.t --- a/tests/test-pending.t +++ b/tests/test-pending.t @@ -44,7 +44,7 @@ > import os, time > from mercurial import ui, localrepo > def rejecthook(ui, repo, hooktype, node, **opts): - > ui.write('hook %s\\n' % repo['tip'].hex()) + > ui.write(b'hook %s\\n' % repo[b'tip'].hex()) > # create the notify file so caller knows we're running > fpath = os.path.join('$d', 'notify') > f = open(fpath, 'w') To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2348: py3: whitelist another six passing tests
durin42 created this revision. Herald added a reviewer: pulkit. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2348 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -27,6 +27,7 @@ test-check-pylint.t test-check-shbang.t test-children.t +test-clone-pull-corruption.t test-clone-r.t test-clone-update-order.t test-commit-unresolved.t @@ -37,6 +38,7 @@ test-convert-clonebranches.t test-copy-move-merge.t test-copytrace-heuristics.t +test-debugbuilddag.t test-debugindexdot.t test-debugrename.t test-diff-binary-file.t @@ -110,6 +112,7 @@ test-histedit-outgoing.t test-http-branchmap.t test-http-clone-r.t +test-identify.t test-imports-checker.t test-inherit-mode.t test-issue1089.t @@ -120,6 +123,7 @@ test-issue1802.t test-issue1877.t test-issue1993.t +test-issue3084.t test-issue4074.t test-issue522.t test-issue586.t @@ -169,6 +173,7 @@ test-pull-branch.t test-pull-http.t test-pull-permission.t +test-pull-pull-corruption.t test-push-checkheads-partial-C1.t test-push-checkheads-partial-C2.t test-push-checkheads-partial-C3.t @@ -217,6 +222,7 @@ test-rename-merge1.t test-rename.t test-repair-strip.t +test-repo-compengines.t test-revert-flags.t test-revert-unknown.t test-revlog-group-emptyiter.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2342: wireproto: fix lingering str(exception) with util.forcebytestr(exception)
durin42 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/D2342 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -927,7 +927,7 @@ r = c.hex() success = 1 except Exception as inst: -r = str(inst) +r = util.forcebytestr(inst) success = 0 return bytesresponse('%d %s\n' % (success, r)) @@ -1055,12 +1055,13 @@ if exc.params: errpart.addparam('params', '\0'.join(exc.params)) except error.Abort as exc: -manargs = [('message', str(exc))] +manargs = [('message', util.forcebytestr(exc))] advargs = [] if exc.hint is not None: advargs.append(('hint', exc.hint)) bundler.addpart(bundle2.bundlepart('error:abort', manargs, advargs)) except error.PushRaced as exc: -bundler.newpart('error:pushraced', [('message', str(exc))]) +bundler.newpart('error:pushraced', +[('message', util.forcebytestr(exc))]) return streamres_legacy(gen=bundler.getchunks()) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2344: merge: make a copy of dict.items() before mutating the dict during iteration
durin42 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/D2344 AFFECTED FILES mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1185,8 +1185,9 @@ def _resolvetrivial(repo, wctx, mctx, ancestor, actions): """Resolves false conflicts where the nodeid changed but the content remained the same.""" - -for f, (m, args, msg) in actions.items(): +# We force a copy of actions.items() because we're going to mutate +# actions as we resolve trivial conflicts. +for f, (m, args, msg) in list(actions.items()): if m == 'cd' and f in ancestor and not wctx[f].cmp(ancestor[f]): # local did change but ended up with same content actions[f] = 'r', None, "prompt same" To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2339: largfiles: replace filter() with listcomp when result needs to be a list
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY filter() is a generator on Python 3, but these cases are used as lists. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2339 AFFECTED FILES hgext/largefiles/lfcommands.py hgext/largefiles/overrides.py CHANGE DETAILS diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -42,7 +42,7 @@ matcher''' m = copy.copy(match) lfile = lambda f: lfutil.standin(f) in manifest -m._files = filter(lfile, m._files) +m._files = [lf for lf in m._files if lfile(lf)] m._fileset = set(m._files) m.always = lambda: False origmatchfn = m.matchfn @@ -57,7 +57,7 @@ m = copy.copy(match) notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in manifest or f in excluded) -m._files = filter(notlfile, m._files) +m._files = [lf for lf in m._files if notlfile(lf)] m._fileset = set(m._files) m.always = lambda: False origmatchfn = m.matchfn diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -365,7 +365,7 @@ at = 0 ui.debug("sending statlfile command for %d largefiles\n" % len(files)) retval = store.exists(files) -files = filter(lambda h: not retval[h], files) +files = [h for h in files if not retval[h]] ui.debug("%d largefiles need to be uploaded\n" % len(files)) for hash in files: To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2341: scmutil: fix requires-file isalnum() check on first byte
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Slice instead of subscript to get a bytes from a bytes. 1. skip-blame just a py3 slice-instead-of-subscript change REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2341 AFFECTED FILES mercurial/scmutil.py CHANGE DETAILS diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -887,7 +887,7 @@ missings = [] for r in requirements: if r not in supported: -if not r or not r[0].isalnum(): +if not r or not r[0:1].isalnum(): raise error.RequirementError(_(".hg/requires file is corrupt")) missings.append(r) missings.sort() To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2338: largefiles: make scheme regex a bytes regex
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame just a b prefix REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2338 AFFECTED FILES hgext/largefiles/storefactory.py CHANGE DETAILS diff --git a/hgext/largefiles/storefactory.py b/hgext/largefiles/storefactory.py --- a/hgext/largefiles/storefactory.py +++ b/hgext/largefiles/storefactory.py @@ -80,7 +80,7 @@ 'ssh': [wirestore.wirestore], } -_scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://') +_scheme_re = re.compile(br'^([a-zA-Z0-9+-.]+)://') def getlfile(ui, hash): return util.chunkbuffer(openstore(ui=ui)._get(hash)) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2340: largefiles: mark headre as bytes regex
durin42 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/D2340 AFFECTED FILES hgext/largefiles/proto.py CHANGE DETAILS diff --git a/hgext/largefiles/proto.py b/hgext/largefiles/proto.py --- a/hgext/largefiles/proto.py +++ b/hgext/largefiles/proto.py @@ -180,7 +180,7 @@ args[r'cmds'] = args[r'cmds'].replace('heads ', 'lheads ') return ssholdcallstream(self, cmd, **args) -headsre = re.compile(r'(^|;)heads\b') +headsre = re.compile(br'(^|;)heads\b') def httprepocallstream(self, cmd, **args): if cmd == 'heads' and self.capable('largefiles'): To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2336: py3: make sure regex is bytes in crecord.py
This revision was automatically updated to reflect the committed changes. Closed by commit rHGab5a86416485: py3: make sure regex is bytes in crecord.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2336?vs=5890=5893 REVISION DETAIL https://phab.mercurial-scm.org/D2336 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -950,7 +950,7 @@ # preprocess the text, converting tabs to spaces text = text.expandtabs(4) # strip \n, and convert control characters to ^[char] representation -text = re.sub(r'[\x00-\x08\x0a-\x1f]', +text = re.sub(br'[\x00-\x08\x0a-\x1f]', lambda m:'^' + chr(ord(m.group()) + 64), text.strip('\n')) if pair is not None: To: pulkit, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2335: py3: use "%d" for integers instead of "%s"
This revision was automatically updated to reflect the committed changes. Closed by commit rHGadf867853dbf: py3: use %d for integers instead of %s (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2335?vs=5889=5892 REVISION DETAIL https://phab.mercurial-scm.org/D2335 AFFECTED FILES mercurial/config.py CHANGE DETAILS diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -154,7 +154,7 @@ if inst.errno != errno.ENOENT: raise error.ParseError(_("cannot include %s (%s)") % (inc, inst.strerror), - "%s:%s" % (src, line)) + "%s:%d" % (src, line)) continue if emptyre.match(l): continue @@ -185,7 +185,7 @@ self._unset.append((section, name)) continue -raise error.ParseError(l.rstrip(), ("%s:%s" % (src, line))) +raise error.ParseError(l.rstrip(), ("%s:%d" % (src, line))) def read(self, path, fp=None, sections=None, remap=None): if not fp: To: pulkit, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2337: py3: make sure we are doing integer division by using '//'
This revision was automatically updated to reflect the committed changes. Closed by commit rHG74f40bdc06bd: py3: make sure we are doing integer division by using // (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2337?vs=5891=5894 REVISION DETAIL https://phab.mercurial-scm.org/D2337 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1335,7 +1335,7 @@ # temporarily disable printing to windows by printstring patchdisplaystring = self.printitem(item, ignorefolding, recursechildren, towin=False) -numlines = len(patchdisplaystring) / self.xscreensize +numlines = len(patchdisplaystring) // self.xscreensize return numlines def sigwinchhandler(self, n, frame): To: pulkit, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2336: py3: make sure regex is bytes in crecord.py
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame because we are just adding b'' REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2336 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -950,7 +950,7 @@ # preprocess the text, converting tabs to spaces text = text.expandtabs(4) # strip \n, and convert control characters to ^[char] representation -text = re.sub(r'[\x00-\x08\x0a-\x1f]', +text = re.sub(br'[\x00-\x08\x0a-\x1f]', lambda m:'^' + chr(ord(m.group()) + 64), text.strip('\n')) if pair is not None: To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2335: py3: use "%d" for integers instead of "%s"
pulkit 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/D2335 AFFECTED FILES mercurial/config.py CHANGE DETAILS diff --git a/mercurial/config.py b/mercurial/config.py --- a/mercurial/config.py +++ b/mercurial/config.py @@ -154,7 +154,7 @@ if inst.errno != errno.ENOENT: raise error.ParseError(_("cannot include %s (%s)") % (inc, inst.strerror), - "%s:%s" % (src, line)) + "%s:%d" % (src, line)) continue if emptyre.match(l): continue @@ -185,7 +185,7 @@ self._unset.append((section, name)) continue -raise error.ParseError(l.rstrip(), ("%s:%s" % (src, line))) +raise error.ParseError(l.rstrip(), ("%s:%d" % (src, line))) def read(self, path, fp=None, sections=None, remap=None): if not fp: To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2337: py3: make sure we are doing integer division by using '//'
pulkit 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/D2337 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1335,7 +1335,7 @@ # temporarily disable printing to windows by printstring patchdisplaystring = self.printitem(item, ignorefolding, recursechildren, towin=False) -numlines = len(patchdisplaystring) / self.xscreensize +numlines = len(patchdisplaystring) // self.xscreensize return numlines def sigwinchhandler(self, n, frame): To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 4 STABLE] tests: add phase testing to test-push-http-bundle1.t
On Sun, Feb 18, 2018 at 10:23 AM, Gregory Szorcwrote: > # HG changeset patch > # User Gregory Szorc > # Date 1518972558 28800 > # Sun Feb 18 08:49:18 2018 -0800 > # Branch stable > # Node ID e978e0c132522bde7cd922a250b0733d7bbf870c > # Parent 4878f45ccd16bb1a3b30097ba0713d61cfb5 > tests: add phase testing to test-push-http-bundle1.t > I sent this series to stable because I found some wire protocol bugs that will require patches on stable. I wanted to have the tests in a more consistent state on stable to facilitate testing. > > test-push-http.t and test-push-http-bundle1.t were initially copies. > Now that we have support for inline test variants, we can combine them. > > One of the variances between the tests is testing of phase moving. > We add the missing code to test-push-http-bundle1.t. > > diff --git a/tests/test-push-http-bundle1.t b/tests/test-push-http- > bundle1.t > --- a/tests/test-push-http-bundle1.t > +++ b/tests/test-push-http-bundle1.t > @@ -66,11 +66,16 @@ expect authorization error: must have au > > expect success > > + $ cat > $TESTTMP/hook.sh <<'EOF' > + > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" > + > EOF > + >$ cat >> .hg/hgrc <> allow_push = * >> [hooks] >> changegroup = sh -c "printenv.py changegroup 0" >> pushkey = sh -c "printenv.py pushkey 0" > + > txnclose-phase.test = sh $TESTTMP/hook.sh >> EOF >$ req >pushing to http://localhost:$HGPORT/ > @@ -79,6 +84,8 @@ expect success >remote: adding manifests >remote: adding file changes >remote: added 1 changesets with 1 changes to 1 files > + remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft > -> public > + remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> > public >remote: changegroup hook: HG_HOOKNAME=changegroup > HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) >% serve errors >$ hg rollback > @@ -95,6 +102,8 @@ expect success, server lacks the httphea >remote: adding manifests >remote: adding file changes >remote: added 1 changesets with 1 changes to 1 files > + remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft > -> public > + remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> > public >remote: changegroup hook: HG_HOOKNAME=changegroup > HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) >% serve errors >$ hg rollback > @@ -111,6 +120,8 @@ expect success, server lacks the unbundl >remote: adding manifests >remote: adding file changes >remote: added 1 changesets with 1 changes to 1 files > + remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft > -> public > + remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> > public >remote: changegroup hook: HG_HOOKNAME=changegroup > HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 > HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve > HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) >% serve errors >$ hg rollback > @@ -140,6 +151,8 @@ has no parameter >remote: adding manifests >remote: adding file changes >remote: added 1 changesets with 1 changes to 1 files > + remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft > -> public > + remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> > public >remote: changegroup hook: * (glob) >% serve errors >$ hg rollback > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 4 STABLE] tests: consolidate test-push-http.t and test-push-http-bundle1.t
# HG changeset patch # User Gregory Szorc# Date 1518976834 28800 # Sun Feb 18 10:00:34 2018 -0800 # Branch stable # Node ID ec71cddd8b6915f7fa2029c641a8385bef1392c3 # Parent fefd57bd957314acd20be2558b8fdeb1b9305e7d tests: consolidate test-push-http.t and test-push-http-bundle1.t These tests were initially copies of each other. Now that we have #testcases support in .t tests, we can consolidate them. The changes to test-push-http.t reflect the differences between that file and test-push-http-bundle1.t. The variances in phases push behavior are the biggest differences. The test will be updated in a subsequent commit to make the differences more clear and to expand test coverage. For now, let's just port the differences verbatim to get the tests consolidated. diff --git a/tests/test-push-http-bundle1.t b/tests/test-push-http-bundle1.t deleted file mode 100644 --- a/tests/test-push-http-bundle1.t +++ /dev/null @@ -1,216 +0,0 @@ -#require killdaemons - -This test checks behavior related to bundle1 that changed or is likely -to change with bundle2. Feel free to factor out any part of the test -which does not need to exist to keep bundle1 working. - - $ cat << EOF >> $HGRCPATH - > [devel] - > # This test is dedicated to interaction through old bundle - > legacy.exchange = bundle1 - > EOF - - $ hg init test - $ cd test - $ echo a > a - $ hg ci -Ama - adding a - $ cd .. - $ hg clone test test2 - updating to branch default - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd test2 - $ echo a >> a - $ hg ci -mb - $ req() { - > hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log - > cat hg.pid >> $DAEMON_PIDS - > hg --cwd ../test2 push http://localhost:$HGPORT/ - > exitstatus=$? - > killdaemons.py - > echo % serve errors - > cat errors.log - > return $exitstatus - > } - $ cd ../test - -expect ssl error - - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - abort: HTTP Error 403: ssl required - % serve errors - [255] - -expect authorization error - - $ echo '[web]' > .hg/hgrc - $ echo 'push_ssl = false' >> .hg/hgrc - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - abort: authorization failed - % serve errors - [255] - -expect authorization error: must have authorized user - - $ echo 'allow_push = unperson' >> .hg/hgrc - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - abort: authorization failed - % serve errors - [255] - -expect success - - $ cat > $TESTTMP/hook.sh <<'EOF' - > echo "phase-move: $HG_NODE: $HG_OLDPHASE -> $HG_PHASE" - > EOF - - $ cat >> .hg/hgrc < allow_push = * - > [hooks] - > changegroup = sh -c "printenv.py changegroup 0" - > pushkey = sh -c "printenv.py pushkey 0" - > txnclose-phase.test = sh $TESTTMP/hook.sh - > EOF - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - remote: adding changesets - remote: adding manifests - remote: adding file changes - remote: added 1 changesets with 1 changes to 1 files - remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public - remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public - remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) - % serve errors - $ hg rollback - repository tip rolled back to revision 0 (undo serve) - -expect success, server lacks the httpheader capability - - $ CAP=httpheader - $ . "$TESTDIR/notcapable" - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - remote: adding changesets - remote: adding manifests - remote: adding file changes - remote: added 1 changesets with 1 changes to 1 files - remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public - remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public - remote: changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: (glob) - % serve errors - $ hg rollback - repository tip rolled back to revision 0 (undo serve) - -expect success, server lacks the unbundlehash capability - - $ CAP=unbundlehash - $ . "$TESTDIR/notcapable" - $ req - pushing to http://localhost:$HGPORT/ - searching for changes - remote: adding changesets - remote: adding manifests - remote: adding file changes - remote: added 1 changesets with 1 changes to 1 files - remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public - remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public - remote: changegroup hook: HG_HOOKNAME=changegroup
[PATCH 4 of 4 STABLE] tests: expand test coverage for updating phases
# HG changeset patch # User Gregory Szorc# Date 1518978019 28800 # Sun Feb 18 10:20:19 2018 -0800 # Branch stable # Node ID 337491de32e3e273c7b98a5259bd053f44acdede # Parent ec71cddd8b6915f7fa2029c641a8385bef1392c3 tests: expand test coverage for updating phases Consolidating the tests demonstrated that there are behavior differences when pushing phases between bundle1 and bundle2. A reason for this is the behavior of legacy pushes where the client queries the state of phases and then conditionally updates phases after an "unbundle" is processed. This behavior is expected. The tests were incomplete because they only tested the case of a publishing repo. In this commit, we add a variant for a non-publishing repo. We still see some differences between the legacy and bundle2 exchanges. But they are less pronounced. The behavior of not firing a pushkey hook when phases are updated as part of changegroup application feels weird to me. I'm not sure if this is a feature or a bug. By the time the "pushkey" or "phases" bundle2 part is applied, the phases have already been moved on a publishing repository. We fire the "pushkey" hook regardless, even though it would be a no-op. This is the part that feels the most buggy. diff --git a/tests/test-push-http.t b/tests/test-push-http.t --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -162,7 +162,7 @@ has no parameter repository tip rolled back to revision 0 (undo serve) $ mv $HGRCPATH.orig $HGRCPATH -expect push success, phase change failure +Test pushing to a publishing repository with a failing prepushkey hook $ cat > .hg/hgrc < [web] @@ -175,6 +175,10 @@ expect push success, phase change failur > EOF #if bundle1 +Bundle1 works because a) phases are updated as part of changegroup application +and b) client checks phases after the "unbundle" command. Since it sees no +phase changes are necessary, it doesn't send the "pushkey" command and the +prepushkey hook never has to fire. $ req pushing to http://localhost:$HGPORT/ @@ -188,7 +192,8 @@ expect push success, phase change failur #endif #if bundle2 - +Bundle2 sends a "pushkey" bundle2 part. This runs as part of the transaction +and fails the entire push. $ req pushing to http://localhost:$HGPORT/ searching for changes @@ -206,30 +211,40 @@ expect push success, phase change failur #endif -expect phase change success +Now remove the failing prepushkey hook. $ cat >> .hg/hgrc < [hooks] > prepushkey = sh -c "printenv.py prepushkey 0" - > [devel] - > legacy.exchange= > EOF -#if bundle1 +We don't need to test bundle1 because it succeeded above. +#if bundle2 $ req pushing to http://localhost:$HGPORT/ searching for changes - no changes found + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files + remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_URL=remote:http:$LOCALIP: % serve errors - [1] - $ hg rollback - repository tip rolled back to revision 0 (undo serve) - #endif -#if bundle2 + $ hg --config extensions.strip= strip -r 1: + saved backup bundle to $TESTTMP/test/.hg/strip-backup/ba677d0156c1-eea704d7-backup.hg + +Now do a variant of the above, except on a non-publishing repository + $ cat >> .hg/hgrc < [phases] + > publish = false + > [hooks] + > prepushkey = sh -c "printenv.py prepushkey 1" + > EOF + +#if bundle1 $ req pushing to http://localhost:$HGPORT/ searching for changes @@ -237,12 +252,61 @@ expect phase change success remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files + remote: prepushkey hook: HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 + remote: pushkey-abort: prepushkey hook exited with status 1 + updating ba677d0156c1 to public failed! % serve errors - $ hg rollback - repository tip rolled back to revision 0 (undo serve) +#endif + +#if bundle2 + $ req + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files + remote: prepushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$
[PATCH 2 of 4 STABLE] tests: port value-less unbundle capability test to test-push-http.t
# HG changeset patch # User Gregory Szorc# Date 1518972777 28800 # Sun Feb 18 08:52:57 2018 -0800 # Branch stable # Node ID fefd57bd957314acd20be2558b8fdeb1b9305e7d # Parent e978e0c132522bde7cd922a250b0733d7bbf870c tests: port value-less unbundle capability test to test-push-http.t This test is present in test-push-http-bundle1.t. Let's add it to test-push-http.t to further unify the tests. diff --git a/tests/test-push-http.t b/tests/test-push-http.t --- a/tests/test-push-http.t +++ b/tests/test-push-http.t @@ -117,6 +117,38 @@ expect success, server lacks the unbundl $ hg rollback repository tip rolled back to revision 0 (undo serve) +expect success, pre-d1b16a746db6 server supports the unbundle capability, but +has no parameter + + $ cat < notcapable-unbundleparam.py + > from mercurial import extensions, httppeer + > def capable(orig, self, name): + > if name == 'unbundle': + > return True + > return orig(self, name) + > def uisetup(ui): + > extensions.wrapfunction(httppeer.httppeer, 'capable', capable) + > EOF + $ cp $HGRCPATH $HGRCPATH.orig + $ cat <> $HGRCPATH + > [extensions] + > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py + > EOF + $ req + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files + remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b: draft -> public + remote: phase-move: ba677d0156c1196c1a699fa53f390dcfc3ce3872: -> public + remote: changegroup hook: * (glob) + % serve errors + $ hg rollback + repository tip rolled back to revision 0 (undo serve) + $ mv $HGRCPATH.orig $HGRCPATH + expect push success, phase change failure $ cat > .hg/hgrc
D2317: manifest: use list(dict) instead of dict.keys() to get a list of keys
durin42 added a comment. In https://phab.mercurial-scm.org/D2317#38442, @indygreg wrote: > This one feels sub-optimal because of the amount of intermediary variables. But I think it should be OK. Agreed, though it's equivalent to what's already happening with .keys(). So far treemanifest code hasn't been prominent in profiles at Google, so it's not high on my optimization list. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2317 To: durin42, #hg-reviewers, pulkit, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2333: py3: make sure we open the files in bytes mode
This revision was automatically updated to reflect the committed changes. Closed by commit rHG7e025d4c6f61: py3: make sure we open the files in bytes mode (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2333?vs=5879=5888 REVISION DETAIL https://phab.mercurial-scm.org/D2333 AFFECTED FILES mercurial/posix.py CHANGE DETAILS diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -113,24 +113,24 @@ if l: if not stat.S_ISLNK(s): # switch file to link -fp = open(f) +fp = open(f, 'wb') data = fp.read() fp.close() unlink(f) try: os.symlink(data, f) except OSError: # failed to make a link, rewrite file -fp = open(f, "w") +fp = open(f, "wb") fp.write(data) fp.close() # no chmod needed at this point return if stat.S_ISLNK(s): # switch link to file data = os.readlink(f) unlink(f) -fp = open(f, "w") +fp = open(f, "wb") fp.write(data) fp.close() s = 0o666 & ~umask # avoid restatting for chmod To: pulkit, #hg-reviewers, yuja, indygreg Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2317: manifest: use list(dict) instead of dict.keys() to get a list of keys
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5245bac09e6a: manifest: use list(dict) instead of dict.keys() to get a list of keys (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2317?vs=5835=5886 REVISION DETAIL https://phab.mercurial-scm.org/D2317 AFFECTED FILES mercurial/manifest.py CHANGE DETAILS diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -1019,7 +1019,7 @@ # yield this dir's files and walk its submanifests self._load() -for p in sorted(self._dirs.keys() + self._files.keys()): +for p in sorted(list(self._dirs) + list(self._files)): if p in self._files: fullp = self._subpath(p) if match(fullp): To: durin42, #hg-reviewers, pulkit, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2318: py3: whitelist another three passing tests
This revision was automatically updated to reflect the committed changes. Closed by commit rHGba1807d9a846: py3: whitelist another three passing tests (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2318?vs=5878=5887 REVISION DETAIL https://phab.mercurial-scm.org/D2318 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -120,6 +120,7 @@ test-issue1802.t test-issue1877.t test-issue1993.t +test-issue4074.t test-issue522.t test-issue586.t test-issue612.t @@ -205,7 +206,9 @@ test-rebase-legacy.t test-rebase-named-branches.t test-rebase-newancestor.t +test-rebase-partial.t test-rebase-pull.t +test-rebase-rename.t test-rebase-transaction.t test-record.t test-remove.t To: durin42, pulkit, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2317: manifest: use list(dict) instead of dict.keys() to get a list of keys
indygreg accepted this revision. indygreg added a comment. This revision is now accepted and ready to land. This one feels sub-optimal because of the amount of intermediary variables. But I think it should be OK. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2317 To: durin42, #hg-reviewers, pulkit, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2316: manifest: correct the one use of iterkeys() on a dict
This revision was automatically updated to reflect the committed changes. Closed by commit rHG413c179cf7d5: manifest: correct the one use of iterkeys() on a dict (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2316?vs=5834=5885 REVISION DETAIL https://phab.mercurial-scm.org/D2316 AFFECTED FILES mercurial/manifest.py CHANGE DETAILS diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -960,7 +960,7 @@ else: files.update(m1.iterkeys()) -for fn in t1._files.iterkeys(): +for fn in t1._files: if fn not in t2._files: files.add(t1._subpath(fn)) To: durin42, #hg-reviewers, pulkit, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2315: py3: use default dict iterator instead of iterkeys
This revision was automatically updated to reflect the committed changes. Closed by commit rHG238646784294: py3: use default dict iterator instead of iterkeys (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2315?vs=5833=5884 REVISION DETAIL https://phab.mercurial-scm.org/D2315 AFFECTED FILES contrib/synthrepo.py hgext/convert/subversion.py hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -589,7 +589,7 @@ date=self.date) if newnode is not None: newrev = repo[newnode].rev() -for oldrev in self.state.iterkeys(): +for oldrev in self.state: self.state[oldrev] = newrev if 'qtip' in repo.tags(): diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -384,7 +384,7 @@ def setrevmap(self, revmap): lastrevs = {} -for revid in revmap.iterkeys(): +for revid in revmap: uuid, module, revnum = revsplit(revid) lastrevnum = lastrevs.setdefault(module, revnum) if revnum > lastrevnum: diff --git a/contrib/synthrepo.py b/contrib/synthrepo.py --- a/contrib/synthrepo.py +++ b/contrib/synthrepo.py @@ -381,7 +381,7 @@ ui.progress(_synthesizing, None) message = 'synthesized wide repo with %d files' % (len(files),) mc = context.memctx(repo, [pctx.node(), nullid], message, -files.iterkeys(), filectxfn, ui.username(), +files, filectxfn, ui.username(), '%d %d' % util.makedate()) initnode = mc.commit() if ui.debugflag: To: durin42, #hg-reviewers, pulkit, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2314: py3: whitelist five more passing tests
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb1c713ab785d: py3: whitelist five more passing tests (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2314?vs=5832=5883 REVISION DETAIL https://phab.mercurial-scm.org/D2314 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -108,6 +108,7 @@ test-histedit-non-commute.t test-histedit-obsolete.t test-histedit-outgoing.t +test-http-branchmap.t test-http-clone-r.t test-imports-checker.t test-inherit-mode.t @@ -137,6 +138,7 @@ test-match.py test-merge-closedheads.t test-merge-commit.t +test-merge-criss-cross.t test-merge-default.t test-merge-internal-tools-pattern.t test-merge-local.t @@ -196,10 +198,13 @@ test-push-warn.t test-rebase-bookmarks.t test-rebase-check-restore.t +test-rebase-dest.t +test-rebase-emptycommit.t test-rebase-inmemory.t test-rebase-issue-noparam-single-rev.t test-rebase-legacy.t test-rebase-named-branches.t +test-rebase-newancestor.t test-rebase-pull.t test-rebase-transaction.t test-record.t To: durin42, pulkit, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2312: hgweb: header dict entries are native strings
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd18c0cf5f3ab: hgweb: header dict entries are native strings (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2312?vs=5830=5881 REVISION DETAIL https://phab.mercurial-scm.org/D2312 AFFECTED FILES mercurial/hgweb/common.py CHANGE DETAILS diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -45,7 +45,7 @@ authentication info). Return if op allowed, else raise an ErrorResponse exception.''' -user = req.env.get('REMOTE_USER') +user = req.env.get(r'REMOTE_USER') deny_read = hgweb.configlist('web', 'deny_read') if deny_read and (not user or ismember(hgweb.repo.ui, user, deny_read)): @@ -61,7 +61,7 @@ return # enforce that you can only push using POST requests -if req.env['REQUEST_METHOD'] != 'POST': +if req.env[r'REQUEST_METHOD'] != r'POST': msg = 'push requires POST request' raise ErrorResponse(HTTP_METHOD_NOT_ALLOWED, msg) To: durin42, #hg-reviewers, indygreg Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2313: httppeer: headers are native strings
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa59ff82154b8: httppeer: headers are native strings (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2313?vs=5831=5882 REVISION DETAIL https://phab.mercurial-scm.org/D2313 AFFECTED FILES mercurial/httppeer.py CHANGE DETAILS diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -335,7 +335,7 @@ if data is not None: self.ui.debug("sending %d bytes\n" % size) -req.add_unredirected_header('Content-Length', '%d' % size) +req.add_unredirected_header(r'Content-Length', r'%d' % size) try: resp = self._openurl(req) except urlerr.httperror as inst: @@ -434,7 +434,7 @@ tempname = bundle2.writebundle(self.ui, cg, None, type) fp = httpconnection.httpsendfile(self.ui, tempname, "rb") -headers = {'Content-Type': 'application/mercurial-0.1'} +headers = {r'Content-Type': r'application/mercurial-0.1'} try: r = self._call(cmd, data=fp, headers=headers, **args) @@ -465,7 +465,7 @@ fh.close() # start http push fp_ = httpconnection.httpsendfile(self.ui, filename, "rb") -headers = {'Content-Type': 'application/mercurial-0.1'} +headers = {r'Content-Type': r'application/mercurial-0.1'} return self._callstream(cmd, data=fp_, headers=headers, **args) finally: if fp_ is not None: To: durin42, #hg-reviewers, indygreg Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2311: keepalive: headers are native strings, mark them as such
This revision was automatically updated to reflect the committed changes. Closed by commit rHG19a04ca90413: keepalive: headers are native strings, mark them as such (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2311?vs=5829=5880 REVISION DETAIL https://phab.mercurial-scm.org/D2311 AFFECTED FILES mercurial/keepalive.py CHANGE DETAILS diff --git a/mercurial/keepalive.py b/mercurial/keepalive.py --- a/mercurial/keepalive.py +++ b/mercurial/keepalive.py @@ -324,11 +324,11 @@ h.putrequest( req.get_method(), urllibcompat.getselector(req), **pycompat.strkwargs(skipheaders)) -if 'content-type' not in headers: -h.putheader('Content-type', -'application/x-www-form-urlencoded') -if 'content-length' not in headers: -h.putheader('Content-length', '%d' % len(data)) +if r'content-type' not in headers: +h.putheader(r'Content-type', +r'application/x-www-form-urlencoded') +if r'content-length' not in headers: +h.putheader(r'Content-length', r'%d' % len(data)) else: h.putrequest( req.get_method(), urllibcompat.getselector(req), To: durin42, #hg-reviewers, indygreg Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2333: py3: make sure we open the files in bytes mode
pulkit updated this revision to Diff 5879. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2333?vs=5862=5879 REVISION DETAIL https://phab.mercurial-scm.org/D2333 AFFECTED FILES mercurial/posix.py CHANGE DETAILS diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -113,24 +113,24 @@ if l: if not stat.S_ISLNK(s): # switch file to link -fp = open(f) +fp = open(f, 'wb') data = fp.read() fp.close() unlink(f) try: os.symlink(data, f) except OSError: # failed to make a link, rewrite file -fp = open(f, "w") +fp = open(f, "wb") fp.write(data) fp.close() # no chmod needed at this point return if stat.S_ISLNK(s): # switch link to file data = os.readlink(f) unlink(f) -fp = open(f, "w") +fp = open(f, "wb") fp.write(data) fp.close() s = 0o666 & ~umask # avoid restatting for chmod To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2318: py3: whitelist another three passing tests
durin42 updated this revision to Diff 5878. durin42 retitled this revision from "py3: whitelist another two passing tests" to "py3: whitelist another three passing tests". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2318?vs=5836=5878 REVISION DETAIL https://phab.mercurial-scm.org/D2318 AFFECTED FILES contrib/python3-whitelist CHANGE DETAILS diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -120,6 +120,7 @@ test-issue1802.t test-issue1877.t test-issue1993.t +test-issue4074.t test-issue522.t test-issue586.t test-issue612.t @@ -205,7 +206,9 @@ test-rebase-legacy.t test-rebase-named-branches.t test-rebase-newancestor.t +test-rebase-partial.t test-rebase-pull.t +test-rebase-rename.t test-rebase-transaction.t test-record.t test-remove.t To: durin42, pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2095: clone: updates the help text for hg clone -r (issue5654) [bugzilla] and hg clone -b
sangeet259 added a comment. Oh! Thanks for letting me know! I will keep that in mind. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2095 To: sangeet259, #hg-reviewers, durin42 Cc: pulkit, durin42, joerg.sonnenberger, dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2331: py3: use range instead of xrange in tests/test-revset2.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8591d6afc629: py3: use range instead of xrange in tests/test-revset2.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2331?vs=5860=5877 REVISION DETAIL https://phab.mercurial-scm.org/D2331 AFFECTED FILES tests/test-revset2.t CHANGE DETAILS diff --git a/tests/test-revset2.t b/tests/test-revset2.t --- a/tests/test-revset2.t +++ b/tests/test-revset2.t @@ -420,7 +420,7 @@ test that repeated `-r` options never eat up stack (issue4565) (uses `-r 0::1` to avoid possible optimization at old-style parser) - $ hg log -T '{rev}\n' `$PYTHON -c "for i in xrange(500): print '-r 0::1 ',"` + $ hg log -T '{rev}\n' `$PYTHON -c "for i in range(500): print '-r 0::1 ',"` 0 1 To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2324: py3: use range instead of xrange on py3 in tests/test-filecache.py
This revision was automatically updated to reflect the committed changes. Closed by commit rHGdaa5f47558cf: py3: use range instead of xrange on py3 in tests/test-filecache.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2324?vs=5853=5869 REVISION DETAIL https://phab.mercurial-scm.org/D2324 AFFECTED FILES tests/test-filecache.py CHANGE DETAILS diff --git a/tests/test-filecache.py b/tests/test-filecache.py --- a/tests/test-filecache.py +++ b/tests/test-filecache.py @@ -11,11 +11,15 @@ extensions, hg, localrepo, +pycompat, ui as uimod, util, vfs as vfsmod, ) +if pycompat.ispy3: +xrange = range + class fakerepo(object): def __init__(self): self._filecache = {} To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2320: py3: explicitly convert result of dict.items() into list
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3e1139b7d617: py3: explicitly convert result of dict.items() into list (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2320?vs=5849=5865 REVISION DETAIL https://phab.mercurial-scm.org/D2320 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -3196,7 +3196,7 @@ guards[g] += 1 if ui.verbose: guards['NONE'] = noguards -guards = guards.items() +guards = list(guards.items()) guards.sort(key=lambda x: x[0][1:]) if guards: ui.note(_('guards in series file:\n')) To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2329: py3: use range instead of xrange in tests/test-issue4074.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG57c671cf7a69: py3: use range instead of xrange in tests/test-issue4074.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2329?vs=5858=5874 REVISION DETAIL https://phab.mercurial-scm.org/D2329 AFFECTED FILES tests/test-issue4074.t CHANGE DETAILS diff --git a/tests/test-issue4074.t b/tests/test-issue4074.t --- a/tests/test-issue4074.t +++ b/tests/test-issue4074.t @@ -4,7 +4,7 @@ $ cat > s.py < import random - > for x in xrange(10): + > for x in range(10): > print > if random.randint(0, 100) >= 50: > x += 1 To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2328: py3: use range instead of xrange in tests/test-convert-mtn.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2b7318db0a89: py3: use range instead of xrange in tests/test-convert-mtn.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2328?vs=5857=5873 REVISION DETAIL https://phab.mercurial-scm.org/D2328 AFFECTED FILES tests/test-convert-mtn.t CHANGE DETAILS diff --git a/tests/test-convert-mtn.t b/tests/test-convert-mtn.t --- a/tests/test-convert-mtn.t +++ b/tests/test-convert-mtn.t @@ -218,7 +218,7 @@ test large file support (> 32kB) >>> fp = open('large-file', 'wb') - >>> for x in xrange(1): fp.write(b'%d\n' % x) + >>> for x in range(1): fp.write(b'%d\n' % x) >>> fp.close() $ md5sum.py large-file 5d6de8a95c3b6bf9e0ffb808ba5299c1 large-file To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2319: py3: use pycompat.byteskwargs() to convert opts keys to bytes
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd822f3fb6be8: py3: use pycompat.byteskwargs() to convert opts keys to bytes (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2319?vs=5848=5864 REVISION DETAIL https://phab.mercurial-scm.org/D2319 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2267,7 +2267,7 @@ To stop managing a patch and move it into permanent history, use the :hg:`qfinish` command.""" q = repo.mq -q.delete(repo, patches, opts) +q.delete(repo, patches, pycompat.byteskwargs(opts)) q.savedirty() return 0 To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2327: py3: use range instead of xrange in tests/test-commandserver.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG257071fd3357: py3: use range instead of xrange in tests/test-commandserver.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2327?vs=5856=5872 REVISION DETAIL https://phab.mercurial-scm.org/D2327 AFFECTED FILES tests/test-commandserver.t CHANGE DETAILS diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -411,7 +411,7 @@ ... # load _phasecache._phaserevs and _phasesets ... runcommand(server, ['log', '-qr', 'draft()']) ... # create draft commits by another process - ... for i in xrange(5, 7): + ... for i in range(5, 7): ... f = open('a', 'ab') ... f.seek(0, os.SEEK_END) ... f.write('a\n') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2330: py3: use range instead of xrange in tests/test-mq-qimport.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb543b3ce608b: py3: use range instead of xrange in tests/test-mq-qimport.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2330?vs=5859=5875 REVISION DETAIL https://phab.mercurial-scm.org/D2330 AFFECTED FILES tests/test-mq-qimport.t CHANGE DETAILS diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t +++ b/tests/test-mq-qimport.t @@ -7,7 +7,7 @@ > assert (len(args) % 2) == 0 > > f = open(path, 'wb') - > for i in xrange(len(args)/2): + > for i in range(len(args)/2): >count, s = args[2*i:2*i+2] >count = int(count) >s = s.decode('string_escape') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2325: py3: use range instead of xrange in tests/test-mq-missingfiles.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG065445b44724: py3: use range instead of xrange in tests/test-mq-missingfiles.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2325?vs=5854=5871 REVISION DETAIL https://phab.mercurial-scm.org/D2325 AFFECTED FILES tests/test-mq-missingfiles.t CHANGE DETAILS diff --git a/tests/test-mq-missingfiles.t b/tests/test-mq-missingfiles.t --- a/tests/test-mq-missingfiles.t +++ b/tests/test-mq-missingfiles.t @@ -10,7 +10,7 @@ > assert (len(args) % 2) == 0 > > f = open(path, 'wb') - > for i in xrange(len(args)/2): + > for i in range(len(args)/2): >count, s = args[2*i:2*i+2] >count = int(count) >s = s.decode('string_escape') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2326: py3: use range instead of xrange in tests/test-walk.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG217b08b1de28: py3: use range instead of xrange in tests/test-walk.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2326?vs=5855=5870 REVISION DETAIL https://phab.mercurial-scm.org/D2326 AFFECTED FILES tests/test-walk.t CHANGE DETAILS diff --git a/tests/test-walk.t b/tests/test-walk.t --- a/tests/test-walk.t +++ b/tests/test-walk.t @@ -519,7 +519,7 @@ $ cd t $ echo fennel > overflow.list - $ $PYTHON -c "for i in xrange(2 / 100): print 'x' * 100" >> overflow.list + $ $PYTHON -c "for i in range(2 / 100): print 'x' * 100" >> overflow.list $ echo fenugreek >> overflow.list $ hg debugwalk 'listfile:overflow.list' 2>&1 | egrep -v '(^matcher: |^xxx)' f fennel fennel exact To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2322: py3: add b'' prefix in test-mq-qrefresh-replace-log-message.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd157b5bfaef0: py3: add b prefix in test-mq-qrefresh-replace-log-message.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2322?vs=5851=5867 REVISION DETAIL https://phab.mercurial-scm.org/D2322 AFFECTED FILES tests/test-mq-qrefresh-replace-log-message.t CHANGE DETAILS diff --git a/tests/test-mq-qrefresh-replace-log-message.t b/tests/test-mq-qrefresh-replace-log-message.t --- a/tests/test-mq-qrefresh-replace-log-message.t +++ b/tests/test-mq-qrefresh-replace-log-message.t @@ -119,7 +119,7 @@ > def reposetup(ui, repo): > class commitfailure(repo.__class__): > def commit(self, *args, **kwargs): - > raise error.Abort('emulating unexpected abort') + > raise error.Abort(b'emulating unexpected abort') > repo.__class__ = commitfailure > EOF To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2332: py3: use range instead of xrange on py3 in tests/test-ui-verbosity.py
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2507bf180413: py3: use range instead of xrange on py3 in tests/test-ui-verbosity.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2332?vs=5861=5876 REVISION DETAIL https://phab.mercurial-scm.org/D2332 AFFECTED FILES tests/test-ui-verbosity.py CHANGE DETAILS diff --git a/tests/test-ui-verbosity.py b/tests/test-ui-verbosity.py --- a/tests/test-ui-verbosity.py +++ b/tests/test-ui-verbosity.py @@ -2,9 +2,13 @@ import os from mercurial import ( +pycompat, ui as uimod, ) +if pycompat.ispy3: +xrange = range + hgrc = os.environ['HGRCPATH'] f = open(hgrc) basehgrc = f.read() To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2323: py3: use range instead on xrange on py3 in tests/test-atomictempfile.py
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3ec9afb951a0: py3: use range instead on xrange on py3 in tests/test-atomictempfile.py (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2323?vs=5852=5868 REVISION DETAIL https://phab.mercurial-scm.org/D2323 AFFECTED FILES tests/test-atomictempfile.py CHANGE DETAILS diff --git a/tests/test-atomictempfile.py b/tests/test-atomictempfile.py --- a/tests/test-atomictempfile.py +++ b/tests/test-atomictempfile.py @@ -7,10 +7,14 @@ import unittest from mercurial import ( +pycompat, util, ) atomictempfile = util.atomictempfile +if pycompat.ispy3: +xrange = range + class testatomictempfile(unittest.TestCase): def setUp(self): self._testdir = tempfile.mkdtemp('atomictempfiletest') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2321: py3: add b'' prefixes in test-mq-eol.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa67b144ef74f: py3: add b prefixes in test-mq-eol.t (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2321?vs=5850=5866 REVISION DETAIL https://phab.mercurial-scm.org/D2321 AFFECTED FILES tests/test-mq-eol.t CHANGE DETAILS diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t --- a/tests/test-mq-eol.t +++ b/tests/test-mq-eol.t @@ -12,27 +12,27 @@ $ cat > makepatch.py < f = open('eol.diff', 'wb') > w = f.write - > w('test message\n') - > w('diff --git a/a b/a\n') - > w('--- a/a\n') - > w('+++ b/a\n') - > w('@@ -1,5 +1,5 @@\n') - > w(' a\n') - > w('-b\r\n') - > w('+y\r\n') - > w(' c\r\n') - > w(' d\n') - > w('-e\n') - > w('\ No newline at end of file\n') - > w('+z\r\n') - > w('\ No newline at end of file\r\n') + > w(b'test message\n') + > w(b'diff --git a/a b/a\n') + > w(b'--- a/a\n') + > w(b'+++ b/a\n') + > w(b'@@ -1,5 +1,5 @@\n') + > w(b' a\n') + > w(b'-b\r\n') + > w(b'+y\r\n') + > w(b' c\r\n') + > w(b' d\n') + > w(b'-e\n') + > w(b'\ No newline at end of file\n') + > w(b'+z\r\n') + > w(b'\ No newline at end of file\r\n') > EOF $ cat > cateol.py < import sys > for line in open(sys.argv[1], 'rb'): - > line = line.replace('\r', '') - > line = line.replace('\n', '') + > line = line.replace(b'\r', b'') + > line = line.replace(b'\n', b'') > print(line) > EOF @@ -44,7 +44,7 @@ Test different --eol values - $ $PYTHON -c 'open("a", "wb").write("a\nb\nc\nd\ne")' + $ $PYTHON -c 'open("a", "wb").write(b"a\nb\nc\nd\ne")' $ hg ci -Am adda adding .hgignore adding a @@ -152,15 +152,15 @@ $ hg init testeol $ cd testeol - $ $PYTHON -c "open('a', 'wb').write('1\r\n2\r\n3\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n3\r\n4')" $ hg ci -Am adda adding a - $ $PYTHON -c "open('a', 'wb').write('1\r\n2\r\n33\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n33\r\n4')" $ hg qnew patch1 $ hg qpop popping patch1 patch queue now empty - $ $PYTHON -c "open('a', 'wb').write('1\r\n22\r\n33\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n22\r\n33\r\n4')" $ hg ci -m changea $ hg --config 'patch.eol=LF' qpush To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2334: py3: use print as a function in test-mq-push-fail.t
yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. print(non_ascii_string) is locale-dependent and doesn't always work. We'll have to use `getattr(sys.stdout, 'buffer', sys.stdout).write()` instead. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2334 To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2333: py3: make sure we open the files in bytes mode
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > posix.py:116 > # switch file to link > fp = open(f) > data = fp.read() Two more missing 'b's, here > posix.py:124 > # failed to make a link, rewrite file > fp = open(f, "w") > fp.write(data) and here. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2333 To: pulkit, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 2] url: show full url of proxy server in debug message
# HG changeset patch # User Yuya Nishihara# Date 1518959531 -32400 # Sun Feb 18 22:12:11 2018 +0900 # Node ID 20fd00ae43f25ab4db11bafc909a6a659bb74cbe # Parent 685bcdd236b592bb7c84290268decfb675bbd5ca url: show full url of proxy server in debug message This only fixes the debug message spotted by issue5796. diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -126,8 +126,7 @@ class proxyhandler(urlreq.proxyhandler): proxyurl = str(proxy) proxies = {'http': proxyurl, 'https': proxyurl} -ui.debug('proxying through http://%s:%s\n' % - (proxy.host, proxy.port)) +ui.debug('proxying through %s\n' % util.hidepassword(proxyurl)) else: proxies = {} ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 2] py3: use bytes() to byte-stringify url object in url.py
# HG changeset patch # User Yuya Nishihara# Date 1518959605 -32400 # Sun Feb 18 22:13:25 2018 +0900 # Node ID b7ebed58e716806e5789779090bc054e98fb43e2 # Parent 20fd00ae43f25ab4db11bafc909a6a659bb74cbe py3: use bytes() to byte-stringify url object in url.py Perhaps we'll have to convert it back and forth from/to bytes and unicode at urllib boundary, but at least util.hidepassword() wants a byte string. diff --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -71,10 +71,10 @@ class passwordmgr(object): u.query = None if not self.ui.interactive(): raise error.Abort(_('http authorization required for %s') % - util.hidepassword(str(u))) + util.hidepassword(bytes(u))) self.ui.write(_("http authorization required for %s\n") % - util.hidepassword(str(u))) + util.hidepassword(bytes(u))) self.ui.write(_("realm: %s\n") % realm) if user: self.ui.write(_("user: %s\n") % user) @@ -124,7 +124,7 @@ class proxyhandler(urlreq.proxyhandler): else: self.no_list = no_list -proxyurl = str(proxy) +proxyurl = bytes(proxy) proxies = {'http': proxyurl, 'https': proxyurl} ui.debug('proxying through %s\n' % util.hidepassword(proxyurl)) else: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2282: util: extract all date-related utils in utils/dateutil module
lothiraldan added a comment. > I asked Alex Gaynor about this and it's not an immediate answer ("You get a basket of trouble. What python version?") > > Could we make the package version be utils (note trailing ess) and migrate things to the package as we have time, making util be the legacy forwarding name and nothing more? That's the current proposal REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2282 To: lothiraldan, #hg-reviewers Cc: durin42, dlax, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2331: py3: use range instead of xrange in tests/test-revset2.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not present on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2331 AFFECTED FILES tests/test-revset2.t CHANGE DETAILS diff --git a/tests/test-revset2.t b/tests/test-revset2.t --- a/tests/test-revset2.t +++ b/tests/test-revset2.t @@ -420,7 +420,7 @@ test that repeated `-r` options never eat up stack (issue4565) (uses `-r 0::1` to avoid possible optimization at old-style parser) - $ hg log -T '{rev}\n' `$PYTHON -c "for i in xrange(500): print '-r 0::1 ',"` + $ hg log -T '{rev}\n' `$PYTHON -c "for i in range(500): print '-r 0::1 ',"` 0 1 To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2333: py3: make sure we open the files in bytes mode
pulkit 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/D2333 AFFECTED FILES mercurial/posix.py CHANGE DETAILS diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -130,7 +130,7 @@ # switch link to file data = os.readlink(f) unlink(f) -fp = open(f, "w") +fp = open(f, "wb") fp.write(data) fp.close() s = 0o666 & ~umask # avoid restatting for chmod To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2332: py3: use range instead of xrange on py3 in tests/test-ui-verbosity.py
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not present on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2332 AFFECTED FILES tests/test-ui-verbosity.py CHANGE DETAILS diff --git a/tests/test-ui-verbosity.py b/tests/test-ui-verbosity.py --- a/tests/test-ui-verbosity.py +++ b/tests/test-ui-verbosity.py @@ -2,9 +2,13 @@ import os from mercurial import ( +pycompat, ui as uimod, ) +if pycompat.ispy3: +xrange = range + hgrc = os.environ['HGRCPATH'] f = open(hgrc) basehgrc = f.read() To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2334: py3: use print as a function in test-mq-push-fail.t
pulkit 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/D2334 AFFECTED FILES tests/test-mq-qpush-fail.t CHANGE DETAILS diff --git a/tests/test-mq-qpush-fail.t b/tests/test-mq-qpush-fail.t --- a/tests/test-mq-qpush-fail.t +++ b/tests/test-mq-qpush-fail.t @@ -31,7 +31,7 @@ popping patch2 popping patch1 patch queue now empty - $ $PYTHON -c 'print "\xe9"' > message + $ $PYTHON -c 'from __future__ import print_function; print("\xe9")' > message $ cat .hg/patches/bad-patch >> message $ mv message .hg/patches/bad-patch $ cat > $TESTTMP/wrapplayback.py
D2330: py3: use range instead of xrange in tests/test-mq-qimport.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not present on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2330 AFFECTED FILES tests/test-mq-qimport.t CHANGE DETAILS diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t +++ b/tests/test-mq-qimport.t @@ -7,7 +7,7 @@ > assert (len(args) % 2) == 0 > > f = open(path, 'wb') - > for i in xrange(len(args)/2): + > for i in range(len(args)/2): >count, s = args[2*i:2*i+2] >count = int(count) >s = s.decode('string_escape') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2325: py3: use range instead of xrange in tests/test-mq-missingfiles.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not present in python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2325 AFFECTED FILES tests/test-mq-missingfiles.t CHANGE DETAILS diff --git a/tests/test-mq-missingfiles.t b/tests/test-mq-missingfiles.t --- a/tests/test-mq-missingfiles.t +++ b/tests/test-mq-missingfiles.t @@ -10,7 +10,7 @@ > assert (len(args) % 2) == 0 > > f = open(path, 'wb') - > for i in xrange(len(args)/2): + > for i in range(len(args)/2): >count, s = args[2*i:2*i+2] >count = int(count) >s = s.decode('string_escape') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2329: py3: use range instead of xrange in tests/test-issue4074.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange in not present on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2329 AFFECTED FILES tests/test-issue4074.t CHANGE DETAILS diff --git a/tests/test-issue4074.t b/tests/test-issue4074.t --- a/tests/test-issue4074.t +++ b/tests/test-issue4074.t @@ -4,7 +4,7 @@ $ cat > s.py < import random - > for x in xrange(10): + > for x in range(10): > print > if random.randint(0, 100) >= 50: > x += 1 To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2327: py3: use range instead of xrange in tests/test-commandserver.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not present on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2327 AFFECTED FILES tests/test-commandserver.t CHANGE DETAILS diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -411,7 +411,7 @@ ... # load _phasecache._phaserevs and _phasesets ... runcommand(server, ['log', '-qr', 'draft()']) ... # create draft commits by another process - ... for i in xrange(5, 7): + ... for i in range(5, 7): ... f = open('a', 'ab') ... f.seek(0, os.SEEK_END) ... f.write('a\n') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2324: py3: use range instead of xrange on py3 in tests/test-filecache.py
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not present on py3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2324 AFFECTED FILES tests/test-filecache.py CHANGE DETAILS diff --git a/tests/test-filecache.py b/tests/test-filecache.py --- a/tests/test-filecache.py +++ b/tests/test-filecache.py @@ -11,11 +11,15 @@ extensions, hg, localrepo, +pycompat, ui as uimod, util, vfs as vfsmod, ) +if pycompat.ispy3: +xrange = range + class fakerepo(object): def __init__(self): self._filecache = {} To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2328: py3: use range instead of xrange in tests/test-convert-mtn.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange in not present on Python 3. This change will make the test a bit slower on Python 2. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2328 AFFECTED FILES tests/test-convert-mtn.t CHANGE DETAILS diff --git a/tests/test-convert-mtn.t b/tests/test-convert-mtn.t --- a/tests/test-convert-mtn.t +++ b/tests/test-convert-mtn.t @@ -218,7 +218,7 @@ test large file support (> 32kB) >>> fp = open('large-file', 'wb') - >>> for x in xrange(1): fp.write(b'%d\n' % x) + >>> for x in range(1): fp.write(b'%d\n' % x) >>> fp.close() $ md5sum.py large-file 5d6de8a95c3b6bf9e0ffb808ba5299c1 large-file To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2323: py3: use range instead on xrange on py3 in tests/test-atomictempfile.py
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY xrange is not available on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2323 AFFECTED FILES tests/test-atomictempfile.py CHANGE DETAILS diff --git a/tests/test-atomictempfile.py b/tests/test-atomictempfile.py --- a/tests/test-atomictempfile.py +++ b/tests/test-atomictempfile.py @@ -7,10 +7,14 @@ import unittest from mercurial import ( +pycompat, util, ) atomictempfile = util.atomictempfile +if pycompat.ispy3: +xrange = range + class testatomictempfile(unittest.TestCase): def setUp(self): self._testdir = tempfile.mkdtemp('atomictempfiletest') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2278: bundle: updates the help text for hg bundle (issue5744) [bugzilla]
khanchi97 added a comment. Okay, I will take care of that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2278 To: khanchi97, #hg-reviewers, yuja Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2319: py3: use pycompat.byteskwargs() to convert opts keys to bytes
pulkit 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/D2319 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2267,7 +2267,7 @@ To stop managing a patch and move it into permanent history, use the :hg:`qfinish` command.""" q = repo.mq -q.delete(repo, patches, opts) +q.delete(repo, patches, pycompat.byteskwargs(opts)) q.savedirty() return 0 To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2321: py3: add b'' prefixes in test-mq-eol.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame because we are just adding b'' REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2321 AFFECTED FILES tests/test-mq-eol.t CHANGE DETAILS diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t --- a/tests/test-mq-eol.t +++ b/tests/test-mq-eol.t @@ -12,27 +12,27 @@ $ cat > makepatch.py < f = open('eol.diff', 'wb') > w = f.write - > w('test message\n') - > w('diff --git a/a b/a\n') - > w('--- a/a\n') - > w('+++ b/a\n') - > w('@@ -1,5 +1,5 @@\n') - > w(' a\n') - > w('-b\r\n') - > w('+y\r\n') - > w(' c\r\n') - > w(' d\n') - > w('-e\n') - > w('\ No newline at end of file\n') - > w('+z\r\n') - > w('\ No newline at end of file\r\n') + > w(b'test message\n') + > w(b'diff --git a/a b/a\n') + > w(b'--- a/a\n') + > w(b'+++ b/a\n') + > w(b'@@ -1,5 +1,5 @@\n') + > w(b' a\n') + > w(b'-b\r\n') + > w(b'+y\r\n') + > w(b' c\r\n') + > w(b' d\n') + > w(b'-e\n') + > w(b'\ No newline at end of file\n') + > w(b'+z\r\n') + > w(b'\ No newline at end of file\r\n') > EOF $ cat > cateol.py < import sys > for line in open(sys.argv[1], 'rb'): - > line = line.replace('\r', '') - > line = line.replace('\n', '') + > line = line.replace(b'\r', b'') + > line = line.replace(b'\n', b'') > print(line) > EOF @@ -44,7 +44,7 @@ Test different --eol values - $ $PYTHON -c 'open("a", "wb").write("a\nb\nc\nd\ne")' + $ $PYTHON -c 'open("a", "wb").write(b"a\nb\nc\nd\ne")' $ hg ci -Am adda adding .hgignore adding a @@ -152,15 +152,15 @@ $ hg init testeol $ cd testeol - $ $PYTHON -c "open('a', 'wb').write('1\r\n2\r\n3\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n3\r\n4')" $ hg ci -Am adda adding a - $ $PYTHON -c "open('a', 'wb').write('1\r\n2\r\n33\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n33\r\n4')" $ hg qnew patch1 $ hg qpop popping patch1 patch queue now empty - $ $PYTHON -c "open('a', 'wb').write('1\r\n22\r\n33\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n22\r\n33\r\n4')" $ hg ci -m changea $ hg --config 'patch.eol=LF' qpush To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2320: py3: explicitly convert result of dict.items() into list
pulkit 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/D2320 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -3196,7 +3196,7 @@ guards[g] += 1 if ui.verbose: guards['NONE'] = noguards -guards = guards.items() +guards = list(guards.items()) guards.sort(key=lambda x: x[0][1:]) if guards: ui.note(_('guards in series file:\n')) To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2322: py3: add b'' prefix in test-mq-qrefresh-replace-log-message.t
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. ski-blame as we just added b'' REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2322 AFFECTED FILES tests/test-mq-qrefresh-replace-log-message.t CHANGE DETAILS diff --git a/tests/test-mq-qrefresh-replace-log-message.t b/tests/test-mq-qrefresh-replace-log-message.t --- a/tests/test-mq-qrefresh-replace-log-message.t +++ b/tests/test-mq-qrefresh-replace-log-message.t @@ -119,7 +119,7 @@ > def reposetup(ui, repo): > class commitfailure(repo.__class__): > def commit(self, *args, **kwargs): - > raise error.Abort('emulating unexpected abort') + > raise error.Abort(b'emulating unexpected abort') > repo.__class__ = commitfailure > EOF To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2095: clone: updates the help text for hg clone -r (issue5654) [bugzilla] and hg clone -b
pulkit added a comment. For future bug fixes: we don't append [bugzilla] at the end of commits which fixes bug, we only mention the issue number. We use bugzilla only for bugs/issues, so an issue number in the commit message refers to the issue on bugzilla. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2095 To: sangeet259, #hg-reviewers, durin42 Cc: pulkit, durin42, joerg.sonnenberger, dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2278: bundle: updates the help text for hg bundle (issue5744) [bugzilla]
pulkit added a comment. For future bug fixes: we don't append [bugzilla] at the end of commits which fixes bug, we only mention the issue number. We only use bugzilla for bugs/issues so an issue number in the commit message refers to the issue on bugzilla. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2278 To: khanchi97, #hg-reviewers, yuja Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2309: tests: port inline Python in test-http-branchmap.t to Python 3
This revision was automatically updated to reflect the committed changes. Closed by commit rHG1e0c9f9f6f36: tests: port inline Python in test-http-branchmap.t to Python 3 (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2309?vs=5827=5846 REVISION DETAIL https://phab.mercurial-scm.org/D2309 AFFECTED FILES tests/test-http-branchmap.t CHANGE DETAILS diff --git a/tests/test-http-branchmap.t b/tests/test-http-branchmap.t --- a/tests/test-http-branchmap.t +++ b/tests/test-http-branchmap.t @@ -68,22 +68,22 @@ > self._file = stdout > > def write(self, data): - > if data == '47\n': + > if data == b'47\n': > # latin1 encoding is one %xx (3 bytes) shorter - > data = '44\n' - > elif data.startswith('%C3%A6 '): + > data = b'44\n' + > elif data.startswith(b'%C3%A6 '): > # translate to latin1 encoding - > data = '%%E6 %s' % data[7:] + > data = b'%%E6 %s' % data[7:] > self._file.write(data) > > def __getattr__(self, name): > return getattr(self._file, name) > - > sys.stdout = StdoutWrapper(sys.stdout) - > sys.stderr = StdoutWrapper(sys.stderr) + > sys.stdout = StdoutWrapper(getattr(sys.stdout, 'buffer', sys.stdout)) + > sys.stderr = StdoutWrapper(getattr(sys.stderr, 'buffer', sys.stderr)) > > myui = ui.ui.load() - > repo = hg.repository(myui, 'a') + > repo = hg.repository(myui, b'a') > commands.serve(myui, repo, stdio=True, cmdserver=False) > EOF $ echo baz >> b/foo To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2303: bundle2: use pycompat.strkwargs as needed
This revision was automatically updated to reflect the committed changes. Closed by commit rHG1ec6fd26f841: bundle2: use pycompat.strkwargs as needed (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2303?vs=5821=5840 REVISION DETAIL https://phab.mercurial-scm.org/D2303 AFFECTED FILES mercurial/bundle2.py CHANGE DETAILS diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -2040,14 +2040,15 @@ allhooks.append(hookargs) for hookargs in allhooks: -op.repo.hook('prepushkey', throw=True, **hookargs) +op.repo.hook('prepushkey', throw=True, + **pycompat.strkwargs(hookargs)) bookstore.applychanges(op.repo, op.gettransaction(), changes) if pushkeycompat: def runhook(): for hookargs in allhooks: -op.repo.hook('pushkey', **hookargs) +op.repo.hook('pushkey', **pycompat.strkwargs(hookargs)) op.repo._afterlock(runhook) elif bookmarksmode == 'records': To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2301: rebase: sort roots by revision
This revision was automatically updated to reflect the committed changes. Closed by commit rHG53be14874ee8: rebase: sort roots by revision (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2301?vs=5819=5838 REVISION DETAIL https://phab.mercurial-scm.org/D2301 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 @@ -1650,7 +1650,9 @@ roots = list(repo.set('roots(%ld)', sortedsrc[0])) if not roots: raise error.Abort(_('no matching revisions')) -roots.sort() +def revof(r): +return r.rev() +roots = sorted(roots, key=revof) state = dict.fromkeys(rebaseset, revtodo) emptyrebase = (len(sortedsrc) == 1) for root in roots: To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2302: tests: add b prefixes to test-rebase-dest.t
This revision was automatically updated to reflect the committed changes. Closed by commit rHG164ed6d54fdf: tests: add b prefixes to test-rebase-dest.t (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2302?vs=5820=5839 REVISION DETAIL https://phab.mercurial-scm.org/D2302 AFFECTED FILES tests/test-rebase-dest.t CHANGE DETAILS diff --git a/tests/test-rebase-dest.t b/tests/test-rebase-dest.t --- a/tests/test-rebase-dest.t +++ b/tests/test-rebase-dest.t @@ -85,20 +85,20 @@ > from mercurial import registrar, revset, revsetlang, smartset > revsetpredicate = registrar.revsetpredicate() > cache = {} - > @revsetpredicate('map') + > @revsetpredicate(b'map') > def map(repo, subset, x): > """(set, mapping)""" - > setarg, maparg = revsetlang.getargs(x, 2, 2, '') + > setarg, maparg = revsetlang.getargs(x, 2, 2, b'') > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) - > mapstr = revsetlang.getstring(maparg, '') - > map = dict(a.split(':') for a in mapstr.split(',')) + > mapstr = revsetlang.getstring(maparg, b'') + > map = dict(a.split(b':') for a in mapstr.split(b',')) > rev = rset.first() > desc = repo[rev].description() > newdesc = map.get(desc) - > if newdesc == 'null': + > if newdesc == b'null': > revs = [-1] > else: - > query = revsetlang.formatspec('desc(%s)', newdesc) + > query = revsetlang.formatspec(b'desc(%s)', newdesc) > revs = repo.revs(query) > return smartset.baseset(revs) > EOF To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2300: httppeer: use %d to format int
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2d513ab7ce94: httppeer: use %d to format int (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2300?vs=5818=5837 REVISION DETAIL https://phab.mercurial-scm.org/D2300 AFFECTED FILES mercurial/httppeer.py CHANGE DETAILS diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -334,7 +334,7 @@ req = self._requestbuilder(pycompat.strurl(cu), data, headers) if data is not None: -self.ui.debug("sending %s bytes\n" % size) +self.ui.debug("sending %d bytes\n" % size) req.add_unredirected_header('Content-Length', '%d' % size) try: resp = self._openurl(req) To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2305: webcommands: use pycompat.strkwargs as needed
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0cacd4df6eb0: webcommands: use pycompat.strkwargs as needed (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2305?vs=5823=5842 REVISION DETAIL https://phab.mercurial-scm.org/D2305 AFFECTED FILES 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 @@ -561,7 +561,7 @@ fentries=filelist, dentries=dirlist, archives=web.archivelist(hex(node)), -**webutil.commonentry(web.repo, ctx)) +**pycompat.strkwargs(webutil.commonentry(web.repo, ctx))) @webcommand('tags') def tags(web, req, tmpl): To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2306: tests: fix get-with-headers.py on python3 when writing to stdout
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc95c8ab2e7ec: tests: fix get-with-headers.py on python3 when writing to stdout (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2306?vs=5824=5843 REVISION DETAIL https://phab.mercurial-scm.org/D2306 AFFECTED FILES tests/get-with-headers.py CHANGE DETAILS diff --git a/tests/get-with-headers.py b/tests/get-with-headers.py --- a/tests/get-with-headers.py +++ b/tests/get-with-headers.py @@ -76,7 +76,7 @@ if args.bodyfile: bodyfh = open(args.bodyfile, 'wb') else: -bodyfh = sys.stdout +bodyfh = getattr(sys.stdout, 'buffer', sys.stdout) # Pretty print JSON. This also has the beneficial side-effect # of verifying emitted JSON is well-formed. To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2308: hgweb_mod: partially undo 8afc25e7effc to fix py3
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa87093e2805d: hgweb_mod: partially undo 8afc25e7effc to fix py3 (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2308?vs=5826=5844 REVISION DETAIL https://phab.mercurial-scm.org/D2308 AFFECTED FILES mercurial/hgweb/hgweb_mod.py CHANGE DETAILS diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -63,8 +63,6 @@ def getstyle(req, configfn, templatepath): fromreq = req.form.get('style', [None])[0] -if fromreq is not None: -fromreq = pycompat.sysbytes(fromreq) styles = ( fromreq, configfn('web', 'style'), To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2307: tags: don't feed both int and None to min()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG18106c3bc94a: tags: dont feed both int and None to min() (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2307?vs=5825=5845 REVISION DETAIL https://phab.mercurial-scm.org/D2307 AFFECTED FILES mercurial/tags.py CHANGE DETAILS diff --git a/mercurial/tags.py b/mercurial/tags.py --- a/mercurial/tags.py +++ b/mercurial/tags.py @@ -739,7 +739,7 @@ entry = bytearray(prefix + fnode) self._raw[offset:offset + _fnodesrecsize] = entry # self._dirtyoffset could be None. -self._dirtyoffset = min(self._dirtyoffset, offset) or 0 +self._dirtyoffset = min(self._dirtyoffset or 0, offset or 0) def write(self): """Perform all necessary writes to cache file. To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2310: wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH
This revision was automatically updated to reflect the committed changes. Closed by commit rHG685bcdd236b5: wireprotoserver: py3 helpfully calls adds HTTP_ to CONTENT_LENGTH (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2310?vs=5828=5847 REVISION DETAIL https://phab.mercurial-scm.org/D2310 AFFECTED FILES mercurial/wireprotoserver.py CHANGE DETAILS diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py --- a/mercurial/wireprotoserver.py +++ b/mercurial/wireprotoserver.py @@ -142,7 +142,10 @@ return args def forwardpayload(self, fp): -length = int(self._req.env[r'CONTENT_LENGTH']) +if r'HTTP_CONTENT_LENGTH' in self._req.env: +length = int(self._req.env[r'HTTP_CONTENT_LENGTH']) +else: +length = int(self._req.env[r'CONTENT_LENGTH']) # If httppostargs is used, we need to read Content-Length # minus the amount that was consumed by args. length -= int(self._req.env.get(r'HTTP_X_HGARGS_POST', 0)) To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2304: webcommands: unpack contents of length-1 dict portably
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa748a5d1d7c3: webcommands: unpack contents of length-1 dict portably (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2304?vs=5822=5841 REVISION DETAIL https://phab.mercurial-scm.org/D2304 AFFECTED FILES 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 @@ -542,7 +542,7 @@ emptydirs = [] h = dirs[d] while isinstance(h, dict) and len(h) == 1: -k, v = h.items()[0] +k, v = next(iter(h.items())) if v: emptydirs.append(k) h = v To: durin42, #hg-reviewers, pulkit Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] minifileset: allow 'path:' patterns to have an explicit trailing slash
On Thu, 15 Feb 2018 22:05:47 -0500, Matt Harbison wrote: > >> Basically, I spent some time last week writing ignore rules for some > >> converted repos, and got into the habit of appending a trailing '/' to > >> ensure the match is a directory, and not just a substring. When I did > >> that here, it took awhile to figure out why the path was being > >> ignored. ('path:' only matches directories) > >> > >> > Can't we reuse some parts of the match module to build a function or > >> regexp > >> > from a pattern string? > >> > >> Probably. I’ve seen a couple cases where a regex pattern would be > >> useful. I just assumed those other match types were part of the > >> performance concern that was the reason for splitting out the mini > >> language in the first place. > > > > (CC Jun) > > > > I think the O(n) concern came from how fileset filters n-length list, not > > from the matcher function itself. > > Unless I'm missing something, the only time patternmatcher walks ctx is if > there's a 'set:' kind. Perhaps. And we can effectively disable 'set:' by not passing ctx to matcher. 57d6c0c74b1b could be partially backed out if we want to handle unsupported 'set:' in matcher. > So if we filter that out that, the relative kinds > (except relglob), and 'subinclude:', I don't see why we can't create one > of those to build the match function. That would allow regex, > rootfilesin, and (rel)glob support too. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2313: httppeer: headers are native strings
pulkit added a comment. This one also needs # skip-blame. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2313 To: durin42, #hg-reviewers Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel