# HG changeset patch # User Richard Westhaver # Date 1721529114 14400 # Node ID d25f982fb8a6b865f14412f17a051d89ee7baf79 # Parent 13e2311f62218eb153de54dd7c51e422567df0ed init vc diff -r 13e2311f6221 -r d25f982fb8a6 .homerc --- a/.homerc Wed May 01 17:44:20 2024 -0400 +++ b/.homerc Sat Jul 20 22:31:54 2024 -0400 @@ -0,0 +1,4 @@ +;;; -*- mode:skel; -*- +:user vc +:packy "~/.stash/packy" +:shell :bash diff -r 13e2311f6221 -r d25f982fb8a6 .skelrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.skelrc Sat Jul 20 22:31:54 2024 -0400 @@ -0,0 +1,5 @@ +;;; .skelrc --- ellis@rurik -*- mode: skel; -*- +:user "vc" +:vc :hg +:log-level :trace +:stash "~/.stash" diff -r 13e2311f6221 -r d25f982fb8a6 hgweb.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hgweb.conf Sat Jul 20 22:31:54 2024 -0400 @@ -0,0 +1,27 @@ +[web] +port = 8888 +encoding = UTF-8 +# allow_archive = zip +baseurl = https://vc.compiler.company +contact = ellis +# templates = theme +# style = monoblue +templates = /home/vc/templates +style = gitweb +# pygments_style = tango +highlightfiles = size('<100k') +# highlightonlymatchfilename = True +logourl = https://vc.compiler.company +staticurl = /static +descend = True +collapse = False +allow_push = ellis +[extensions] +highlight = +[paths] +/ = /home/vc/comp/** +packy = /home/vc/packy +scratch = /home/vc/scratch/** +[phases] +publish = False +new-commit = draft \ No newline at end of file diff -r 13e2311f6221 -r d25f982fb8a6 hgweb.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hgweb.ini Sat Jul 20 22:31:54 2024 -0400 @@ -0,0 +1,17 @@ +[uwsgi] +master = true +# max-requests = 1000 +# logto = {log file path}/hgweb-uwsgi.log +uid = vc # set process owner +gid = vc +stats = /run/vc/stats.sock +chmod-socket = 666 +cap = setgid,setuid +# https://www.mercurial-scm.org/wiki/PublishRepositoriesOnNginx +plugins = python +socket = /run/vc/hgweb.sock +chdir = /home/vc/ +wsgi-file = hgweb.wsgi +# https://stackoverflow.com/questions/15878176/uwsgi-invalid-request-block-size +# http://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html +# buffer-size = 65535 diff -r 13e2311f6221 -r d25f982fb8a6 hgweb.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hgweb.py Sat Jul 20 22:31:54 2024 -0400 @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +config = b"/home/vc/hgweb.conf" +# enable demandloading to reduce startup time +from mercurial import demandimport; demandimport.enable() +from mercurial.hgweb import hgweb, wsgicgi +app = hgweb(config) +wsgicgi.launch(app) diff -r 13e2311f6221 -r d25f982fb8a6 static/followlines.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/static/followlines.js Sat Jul 20 22:31:54 2024 -0400 @@ -0,0 +1,286 @@ +// followlines.js - JavaScript utilities for followlines UI +// +// Copyright 2017 Logilab SA +// +// This software may be used and distributed according to the terms of the +// GNU General Public License version 2 or any later version. + +//** Install event listeners for line block selection and followlines action */ +document.addEventListener('DOMContentLoaded', function() { + var sourcelines = document.getElementsByClassName('sourcelines')[0]; + if (typeof sourcelines === 'undefined') { + return; + } + // URL to complement with "linerange" query parameter + var targetUri = sourcelines.dataset.logurl; + if (typeof targetUri === 'undefined') { + return; + } + + // Tag of children of "sourcelines" element on which to add "line + // selection" style. + var selectableTag = sourcelines.dataset.selectabletag; + if (typeof selectableTag === 'undefined') { + return; + } + + var isHead = parseInt(sourcelines.dataset.ishead || "0"); + + //* position "element" on top-right of cursor */ + function positionTopRight(element, event) { + var x = (event.clientX + 10) + 'px', + y = (event.clientY - 20) + 'px'; + element.style.top = y; + element.style.left = x; + } + + // retrieve all direct *selectable* children of class="sourcelines" + // element + var selectableElements = Array.prototype.filter.call( + sourcelines.children, + function(x) { return x.tagName === selectableTag; }); + + var btnTitleStart = 'start following lines history from here'; + var btnTitleEnd = 'terminate line block selection here'; + + //** return a + var button = document.createElement('button'); + button.textContent = 'x'; + buttonDiv.appendChild(button); + div.appendChild(buttonDiv); + + //