A Scalable, User-Friendly Source Control System.
Go to file
Alexander Plavin c6105565d1 hgweb: code selection without line numbers in file source view
All the source lines are put in a <pre> tag, which gives correct display and
copy&paste in both Chromium (WebKit) and FireFox: line numbers are not copied,
all the tabs and spaces are kept. This doesn't change the visual appearance
of the view compared to current hgweb version and doesn't use any JS code.
Also, stripes in this view are now generated clientside with CSS.

This implementation is chosen because other variants have important issues:

Strategy             FF              Chrome

current             D,LT,E,T,L        D,L
pre                 S,NW              S,NW
pre/div/nbsp        LT,E,T,TS,NW      TS,NW
pre/div/br          LT,E,T,NW         NW
ol/li/nbsp          LT,E,T,TS,AJ      TS,AJ
ol/li/br            LT,E,T,AJ         AJ
pre/span            LV                LV

Legend

Strategies:
- current: implemented in hgweb before this patch, i.e. divs for each line,
and line numbers links in the div too
- pre: the whole code in one pre tag with newlines, all line numbers
in another one with 'float: left'
- pre/div/{nbsp,br}: same as just 'pre', but separate divs for each line and
&nbsp; or <br> instead of empty lines (otherwise they are not copied at all)
- ol/li/{nbsp,br}: a single ol with li's and divs for each line,
&nbsp; or <br> same as in previous strategy
- pre/span: this patch

Problems:
D = (very minor) display problems, like wrong width of leading tabs
LT = loses leading/trailing whitespace
E = loses embedded whitespace
B = loses blank lines
T = loses tabs
L = selects line numbers
LV = (only) visually selects line numbers
LVE = (only) visually selects line numbers at empty lines
S = no stripes (and no ability to easily highlight
lines-which-are-linked-at in the future)
TS = space copied instead of empty line
AJ = get anchor links only with JS (they work even without)
NW = no linewrap easily possible (in future)

As for browser versions compatibility, the CSS tricks used are supported in
(according to caniuse.com):
a) line numbers generation with 'content:' property and CSS counters:
IE 8+, all other popular browsers (in pre-WebKit Opera numbers are being copied)
b) stripes ('nth-child' selector):
IE 8+, FF 3.5+, Safari 3.2+, Opera 9.5+, all other popular browsers
c) line numbers are not visually selected ('user-select:' property):
IE 10+, Opera 15.0+, all other popular browsers

This patch is based on a demo implementation by
Martin Geisler <martin@geisler.net>.
2013-07-04 14:18:44 +04:00
contrib check-code: concatenate "check-code" on compile time 2013-07-01 06:50:58 +02:00
doc cleanup: drop unused variables and an unused import 2013-07-01 20:48:56 +02:00
hgext win32mbcs: wrap util.split() 2013-07-04 23:05:59 +09:00
i18n i18n-ja: synchronized with cc131b22c3a9 2013-07-01 05:25:53 +09:00
mercurial hgweb: code selection without line numbers in file source view 2013-07-04 14:18:44 +04:00
tests hgweb: code selection without line numbers in file source view 2013-07-04 14:18:44 +04:00
.hgignore exewrapper: adapt for legacy HackableMercurial 2012-08-07 11:04:41 +02:00
.hgsigs Added signature for changeset 95fbbda7fcd0 2013-07-01 18:07:33 -05:00
CONTRIBUTORS Add note to CONTRIBUTORS file 2007-11-07 21:10:30 -06:00
COPYING COPYING: refresh with current address from fsf.org 2011-06-02 11:17:02 -05:00
hg rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
hgeditor Fixed a bashism with the use of $RANDOM in hgeditor. 2010-05-19 18:06:35 +02:00
hgweb.cgi mq: add a warning about uncommitted changes for qfinish 2011-11-10 15:40:34 -06:00
Makefile check-code: add Makefile target to run check-code 2013-02-09 15:57:04 +01:00
README readme: mention how to run in-place 2012-03-02 21:43:55 +02:00
setup.py setup: make error message for missing Python headers more helpful 2013-04-12 16:55:34 -04:00

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install:

 $ make            # see install targets
 $ make install    # do a system-wide install
 $ hg debuginstall # sanity-check setup
 $ hg              # see help

Running without installing:

 $ make local      # build for inplace usage
 $ ./hg --version  # should show the latest version

See http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.