Commit Graph

9002 Commits

Author SHA1 Message Date
Greg Ward
9468b4b81c revset: polish explanation of the difference between file() and filelog() 2012-07-25 22:41:26 -04:00
Augie Fackler
d7b1ad91f4 strip: move bookmarks to nearest ancestor rather than '.'
If you've got this graph:

0-1-2
   \
    3

and 3 is checked out, 2 is bookmarked with "broken", and you do "hg
strip 2", the bookmark will move to 3, not 1. That's always struck me
as a bug.

This change makes bookmarks move to the tipmost ancestor of
the stripped set rather than the currently-checked-out revision, which
is what I always expected should happen.
2012-07-26 16:57:50 -05:00
Matt Mackall
9eb6c76d12 merge with crew 2012-07-27 12:32:02 -05:00
Patrick Mezard
00c80f6fa8 webcommands: do not modify repo.tagslist()
Repeatedly refreshing a gitweb summary page served by hg serve would
show the tags list switching between two different sequences.
2012-07-27 17:48:49 +02:00
Patrick Mezard
2e04c51661 identity: show trailing '+' for dirty subrepos (issue2839) 2012-07-27 13:56:19 +02:00
Patrick Mezard
a34c356944 discovery: fix invalid comment about extinct being ignored 2012-07-27 10:16:20 +02:00
Pierre-Yves David
35a54a30a2 obsolete: fix decoding error message arguments 2012-07-26 16:21:43 +02:00
Patrick Mezard
f40d444448 push: do not try to push remote obsolete if local has none 2012-07-24 21:20:56 +02:00
Mads Kiilerich
377db36818 help: fix some instances of 'the the' 2012-07-26 02:54:13 +02:00
Pierre-Yves.David@ens-lyon.org
08abbc7fb2 clone: copy obsolete markers during local clone
This change adds `obsstore` to the list of files copied by local clone,
until now changesets were copied without their obsolete markers.

Note: extinct changesets were and are still included by such clones to
enable hardlinking. There is no obvious reason to prevent their exchange
here.

Rebased by Patrick Mezard <patrick@mezard.eu>
2012-07-25 19:02:35 +02:00
Patrick Mezard
7221d12e58 discovery: add extinct changesets to outgoing.excluded
Before this change, push would incorrectly fast-path the bundle
generation when extinct changesets are involved, because they are not
added to outgoing.excluded. The reason to do so are related to
outgoing.excluded being assumed to contain only secret changesets by
scmutil.nochangesfound(), when displaying warnings like:

 changes found (ignored 9 secret changesets)

Still, outgoing.excluded seems like a good API to report the extinct
changesets instead of dedicated code and nothing in the docstring
indicates it to be bound to secret changesets. This patch adds extinct
changesets to outgoing.excluded and fixes scmutil.nochangesfound() to
filter the excluded node list.

Original version and test by Pierre-Yves.David@ens-lyon.org
2012-07-25 19:34:31 +02:00
FUJIWARA Katsunori
cc080612f7 revset: add explanation about difference between 'filelog()' and 'file()' 2012-07-25 16:15:28 +09:00
Matt Mackall
c40407a58a hgweb: improve colors for comparison page
delete: red -> red
insert: green -> yellow
change: yellow -> gray
2012-07-25 14:49:53 -05:00
Bryan O'Sullivan
819d32ac79 merge with crew-stable 2012-07-23 15:40:19 -07:00
Bryan O'Sullivan
9f3858de6e util: delegate seek and tell methods of atomictempfile 2012-07-23 15:38:43 -07:00
Martin Geisler
5b013e2061 encoding: add fast-path for ASCII uppercase.
This copies the performance hack from encoding.lower (e7a5733d533f).

The case-folding logic that kicks in on case-insensitive filesystems
hits encoding.upper hard: with a repository with 75k files, the
timings went from

  hg perfstatus
  ! wall 3.156000 comb 3.156250 user 1.625000 sys 1.531250 (best of 3)

to

  hg perfstatus
  ! wall 2.390000 comb 2.390625 user 1.078125 sys 1.312500 (best of 5)

This is a 24% decrease. For comparison, Mercurial 2.0 gives:

  hg perfstatus
  ! wall 2.172000 comb 2.171875 user 0.984375 sys 1.187500 (best of 5)

so we're only 10% slower than before we added the extra case-folding
logic.

The same decrease is seen when executing 'hg status' as normal, where
we go from:

  hg status --time
  time: real 4.322 secs (user 2.219+0.000 sys 2.094+0.000)

to

  hg status --time
  time: real 3.307 secs (user 1.750+0.000 sys 1.547+0.000)
2012-07-23 15:55:26 -06:00
Martin Geisler
4f96956c09 encoding: use s.decode to trigger UnicodeDecodeError
When calling encode on a str, the string is first decoded using the
default encoding and then encoded. So

  s.encode('ascii') == s.decode().encode('ascii')

We don't care about the encode step here -- we're just after the
UnicodeDecodeError raised by decode if it finds a non-ASCII character.

This way is also marginally faster since it saves the construction of
the extra str object.
2012-07-23 15:55:22 -06:00
Thomas Arendsen Hein
2b505739fb dispatch: fix traceback when extension was tested with newer versions only
The "worst" extension still is the one tested with the lowest tested version
below the current version of Mercurial, but if an extension with was only
tested with newer versions, it is considered a candidate for a bad extension,
too. In this case extensions which have been tested with higher versions of
Mercurial are considered better. This allows finding the oldest extension if
ct can't be calculated correctly and therefore defaults to an empty tuple, and
it involves less changes to the comparison logic during the current code
freeze.
2012-07-19 21:20:56 +02:00
Matt Mackall
3d4a489c40 merge with crew 2012-07-18 19:08:11 -05:00
Martin Geisler
c1e716912d merge with stable 2012-07-19 00:54:33 +02:00
Martin Geisler
56abbb58cc windows: removed duplicate termwidth definition
Changeset 8c1e21a3407c caused this when the "from win32 import *" line
was replaced with explicit import statements: the wildcard import was
at the bottom of the file and so windows.termwidth was overwritten by
win32.termwidth as indented, but the new explicit import statements
were at the top and so win32.termwidth got lost.

With the switch to ctypes, win32 can always be imported and so the
fallback termwidth in windows is no longer needed.
2012-07-19 00:53:27 +02:00
Pierre-Yves David
5e5a2af20c checkheads: take future obsoleted heads into account
If we push some successors they will likely create a new head on
remote. However as the obsoleted head will disappear after the push we
are not really increasing the number of heads.

There is several case which will lead to extra being actually pushed. But this
first changeset aims to be simple. See the inline comment for details.

Without this change, you need to push --force every time you want to
push a newer version which is very error prone.

The remote side still display +n heads on unbundle because it does not have the
obsolete marker at unbundle time.
2012-07-17 17:59:29 +02:00
Pierre-Yves David
0038209994 obsolete: add an any successors function
This function yield every nodes which succeed to a group of nodes.

The first user will be checkheads who need to know if we push successors for
remote extra heads.
2012-07-17 17:31:29 +02:00
Pierre-Yves David
2013cc02a8 checkheads: extract bookmark computation from the branch loop
No branch specific data are used in the computation of the bookmarked heads. We
can only compute it once.
2012-07-17 18:14:16 +02:00
Pierre-Yves David
c77673e2fa checkheads: simplify the structure build by preprocessing
All useful data are now gathered in a single dictionnary.
`branchmapsummary` is renamed to `headssummary` and its return value
is greatly simplified.
2012-07-17 16:30:42 +02:00
Pierre-Yves David
dab9cf6c01 _updatebranchcache: prevent deleting dict key during iteration
We use dict.keys() to fetch all keys before starting to delete some. Otherwise
python complains that the dictionnary is altered during iteration.
2012-07-17 16:16:17 +02:00
Pierre-Yves David
50a38d5114 checkheads: extract branchmap preprocessing
The checkheads function is far too complicated. This extract help to explicite
what part of the preprocessing are reused by the actual check.

This the first step toward a wider refactoring.
2012-07-17 18:21:49 +02:00
Pierre-Yves.David@ens-lyon.org
a82f344ba4 obsolete: mark unreachable extinct changesets as hidden
The repo.hiddenrevs set is updated with all extinct() changesets which aren't
descendants of either:

- the current working copy,
- a bookmark,
- a tag.
2012-07-16 17:56:50 +02:00
Pierre-Yves David
edc2b520d9 hidden: move hiddenrevs set on the repository
This set is always accessed through the repo for now. Having this set
carried by the changelog make it complicated to:

- initialize it, computing hidden set may involve revset call
- lazy compute it, (1) only the changelog can detect someone access it,
                   (2) only the repo have enought knowledge to compute it.

In later version I expect he changelog to apply filtering itself and the set to
be carried by changelog again.
2012-07-16 17:44:46 +02:00
Pierre-Yves David
648d2fdbd8 obsolete: do not exchange extinct changesets
Extinct changesets are excluded from all exchange operations. This is a silent
exclusion because the user should not need to be aware of them.

There is no reason to strongly enforce this exclusion except implementation
simplicity. User should be able to explicitly request an extinct changeset in
the future.
2012-07-13 14:38:49 +02:00
Pierre-Yves David
afa28ff113 repo: move visibleheads and visiblebranchmap logic in discovery
They were previously inside the mercurial.phases module, but obsolete
logic will need them to exclude `extinct` changesets from pull and
push.

The proper and planned way to implement such filtering is still to apply a
changelog level filtering. But we are far to late in the cycle to implement and
push such a critical piece of code (changelog filtering). With Matt Mackall
approval I'm extending this quick and dirty mechanism for obsolete purpose.

Changelog level filtering should come during the next release cycle.
2012-07-17 01:22:31 +02:00
Pierre-Yves David
ae5abd69f4 localpeer: return only visible heads and branchmap
Now that we have localpeer, we can apply filtering on heads and branchmap the
same way it's done for wireprotocol peer.
2012-07-17 01:04:45 +02:00
Adrian Buehlmann
0fe77b0110 util, posix: eliminate encodinglower and encodingupper
bffd8f8dfc85 claims this was needed "to avoid cyclic dependency", but there is
no cyclic dependency.

windows.py already imports encoding, posix.py can import it too, so we can
simply use encoding.upper in windows.py and in posix.py.

(this is a partial backout of bffd8f8dfc85)
2012-07-18 14:41:58 +02:00
Pierre-Yves.David@ens-lyon.org
2c6293bccf httprepo: ensure Content-Type header exists when pushing data
Otherwise the wireprotocol just hangs while trying to send data. (And
nothing is received at the other side)
2012-07-13 13:21:20 +02:00
Pierre-Yves.David@ens-lyon.org
1f1aafaab3 obsolete: obsstore.add now takes a list of markers.
This allow efficient IO and it greatly simplify the merging of markers.
2012-07-13 22:15:11 +02:00
Pierre-Yves.David@ens-lyon.org
25defec21b obsolete: refactor writemarkers to only encode them
The function is now able to write the version header as necessary. The function
now yield bytes to be written to a stream.

This should ease later use of this function for wireprotocol based exchanged.

Prepare the public use of the writemarker by wireprotocol function.
2012-07-12 19:58:07 +02:00
Adrian Buehlmann
18bc26986d update: put rules for uncommitted changes into verbose help section 2012-07-14 18:29:46 +02:00
wujek srujek
a8963fc179 hgweb: side-by-side comparison functionality
Adds new web command to the core, ``comparison``, which enables colorful
side-by-side change display, which for some might be much easier to work with
than the standard line diff output. The idea how to implement comes from the
SonicHq extension.
The web interface gets a new link to call the comparison functionality. It lets
users configure the amount of context lines around change blocks, or to show
full files - check help (also in this changeset) for details and defaults. The
setting in hgrc can be overridden by adding ``context=<value>`` to the request
query string. The comparison creates addressable lines, so as to enable sharing
links to specific lines, just as standard diff does.
Incorporates updates to all web related styles.

Known limitations:
* the column diff is done against the first parent, just as the standard diff
* this change allows examining diffs for single files only (as I am not sure if
  examining the whole changeset in this way would be helpful)
* syntax highlighting of the output changes is not performed (enabling the
  highlight extension has no influence on it)
2012-07-08 17:17:02 +02:00
Joshua Redstone
30df933365 scmutil: 25% speedup in casecollisionauditor
On a large repository, switching casecollisionauditor to lowercasing all file
names at once rather than one at a time improves hg-add time by 25%.
2012-07-06 13:56:40 -07:00
Adrian Buehlmann
bca295056a obsolete: os.SEEK_END first appeared in Python 2.5
fixes 5274228efcdc failing for Python 2.4
2012-07-17 00:55:22 +02:00
Matt Harbison
0afe294dbc outgoing: accept revset argument for --rev
There may be a more generic way that would add revset support to more commands
by adding revset support to addbranchrevs(), but given the proximity of the next
code freeze, a minimal change seems like the better choice.
2012-07-15 12:43:10 -04:00
Matt Mackall
c49b56acb4 dirstate: drop assert 2012-07-16 16:19:53 -05:00
Simon Heimberg
8eb4380be9 hooks: print out more information when loading a python hook fails
When loading a python hook with file syntax fails, there is no
information that this happened while loading a hook. When the python
file does not exist even the file name is not printed. (Only that a
file is missing.)

This patch adds this information and a test for loading a non existing file and
a directory not being a python module.
2012-07-06 18:41:25 +02:00
Adrian Buehlmann
18cf0b55ff revert: use term "uncommitted merge" in help text
to make sure users can't possibly be mislead to try this for canceling a
*merge changeset*.
2012-07-09 17:51:46 +02:00
Adrian Buehlmann
f4bd1660eb update: mention how update can be used to cancel an uncommitted merge 2012-07-10 21:26:18 +02:00
Adrian Buehlmann
bd2cde6763 update: move help text about parent revision higher up
emphasizing how important the parent revision is
2012-07-10 11:15:22 +02:00
Adrian Buehlmann
69f9a7e33f rollback: move examples and --force note in help into verbose section
Plain 'hg help rollback' now looks like this:

  $ hg help rollback
  hg rollback

  roll back the last transaction (dangerous)

      This command should be used with care. There is only one level of
      rollback, and there is no way to undo a rollback. It will also restore
      the dirstate at the time of the last transaction, losing any dirstate
      changes since that time. This command does not alter the working
      directory.

      Transactions are used to encapsulate the effects of all commands that
      create new changesets or propagate existing changesets into a repository.

      This command is not intended for use on public repositories. Once changes
      are visible for pull by other users, rolling a transaction back locally
      is ineffective (someone else may already have pulled the changes).
      Furthermore, a race is possible with readers of the repository; for
      example an in-progress pull from the repository may fail if a rollback is
      performed.

      Returns 0 on success, 1 if no rollback data is available.

  options:

   -n --dry-run do not perform actions, just print output
   -f --force   ignore safety measures
      --mq      operate on patch repository

  use "hg -v help rollback" to show more info
2012-07-11 09:12:31 +02:00
Adrian Buehlmann
427ff24c6f rollback: split off command example paragraph in help 2012-07-11 09:08:26 +02:00
Martin Geisler
37556a7588 subrepo: add missing newline in Git warning message 2012-07-12 09:58:40 +02:00
Adrian Buehlmann
3087eeedfb dirstate: eliminate redundant check parameter on _addpath()
state == 'a' implies check

I fail to see what the point of this check parameter is. Near as I can see,
the only _addpath call where it was set to True was in add(), but there, state
is 'a'.

This is a follow-up to 24a646d9943a.
2012-07-04 01:31:37 +02:00