tests/test-push-cgi.t
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 25 Apr 2018 09:24:07 -0700
branchstable
changeset 37819 ee3d58b4a47f
parent 33262 8e6f4939a69a
child 39621 23b749b84b8a
permissions -rw-r--r--
revlog: make pure version of _partialmatch() support 40-byte hex nodeids Without this patch, test-histedit-arguments.t would fail when run with --pure. It turned out to be because the pure version of _partialmatch() does not support full 40-byte hex nodeids. When histedit's instructions include things like "pick tip", it resolves the "tip" revision early to a full nodeid (but plain hex nodeid prefixes are not resolved to full nodeids). Then the nodeid (full or not) is looked up using to a full nodeid later. This step is what fails in pure mode. It has been failing since my c4131138eadb (histedit: look up partial nodeid as partial nodeid, 2018-04-06). I haven't verified, but I suspect histedit instructions like "pick <full hex nodeid>" would have been failing before my commit too, though. The fix is trivial: change a "< 40" to "<= 40". Differential Revision: https://phab.mercurial-scm.org/D3428
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 18957
diff changeset
     1
#require no-msys # MSYS will translate web paths as if they were file paths
15567
8b84d040d9f9 tests: introduce 'hghave msys' to skip tests that would fail because of msys
Mads Kiilerich <mads@kiilerich.com>
parents: 13946
diff changeset
     2
13397
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     3
This is a test of the push wire protocol over CGI-based hgweb.
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     4
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     5
initialize repository
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     6
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     7
  $ hg init r
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     8
  $ cd r
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
     9
  $ echo a > a
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    10
  $ hg ci -A -m "0"
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    11
  adding a
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    12
  $ echo '[web]' > .hg/hgrc
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    13
  $ echo 'allow_push = *' >> .hg/hgrc
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    14
  $ echo 'push_ssl = false' >> .hg/hgrc
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    15
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    16
create hgweb invocation script
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    17
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    18
  $ cat >hgweb.cgi <<HGWEB
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    19
  > import cgitb
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    20
  > cgitb.enable()
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    21
  > from mercurial import demandimport; demandimport.enable()
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    22
  > from mercurial.hgweb import hgweb
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    23
  > from mercurial.hgweb import wsgicgi
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    24
  > application = hgweb('.', 'test repository')
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    25
  > wsgicgi.launch(application)
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    26
  > HGWEB
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset
    27
  $ chmod 755 hgweb.cgi
6f9616a46f7c tests: push wire protocol over CGI-based hgweb
Steven Brown <StevenGBrown@gmail.com>
parents:
diff changeset