Commit Graph

17116 Commits

Author SHA1 Message Date
Matt Harbison
a6f5e08a5d largefiles: mark as a first party extension 2012-07-20 22:10:52 -04:00
Matt Harbison
a3f198c97e largefiles: ensure addlargefiles() doesn't add a standin as a largefile
An easy way to force this (and cause a traceback) prior to the fix for 3507 was

  $ touch large
  $ hg add --large large
  $ hg ci -m "add"
  $ hg remove large
  $ touch large
  $ hg addremove --config largefiles.patterns=**large

This patch also detected (and corrected) a previous test where a standin got
added as a largefile (without a traceback).
2012-07-19 23:35:13 -04:00
Matt Harbison
b617460d47 largefiles: fix a traceback when addremove follows a remove (issue3507)
The problem only occurred if a file was removed with 'hg rm' (as opposed to the
OS utilities), and then addremove was run before a commit.  Both normal and
large files were affected.

Ensuring that the file exists prior to an lstat() for size seems like the Right
Thing.  But oddly enough, the missing file that was causing lstat() to blow up
was a standin when a largefile was removed, which seems fishy, because a standin
should never be added as a largefile.  I was then able to get a standin added as
a largefile (whose name is 'large') with

   hg addremove --config largefiles.patterns=**large

which also causes a backtrace.  That will be fixed next.
2012-07-19 11:12:05 -04:00
Matt Harbison
f0d41a8692 largefiles: defer lfdirstate.drop() until after commit (issue3364)
The example in comment #9 of the bug writeup must be run exactly- it was the
commit after the rm and prior to the addremove that screwed things up, because
that commit noticed that the largefile was missing, called drop(), and then the
original commit function did nothing (due to the file in the '!' state).  The
addremove command properly put it into the 'R' state, but it remained stuck in
that state (because commit insisted 'nothing changed').  Without the commit
prior to addremove, the problem didn't occur.

Maybe this is an indication that lfdirstate needs to take a few more hints from
the regular dirstate, regardless of what _it_ thinks the state is- similar
inconsistency is probably still possible with this patch if the original commit
succeeds but the lfdirstate write fails.
2012-07-19 10:00:15 -04:00
Matt Harbison
91452ea7b9 largefiles: fix addremove with -R option
If a file was missing, the missing list contained a path relative to the repo.
When building the matcher from that list, the file name ended up concatenated to
cwd, causing the command to abort with '<file> not under root'.  This rebuilds
the missing list with paths relative to cwd.
2012-07-19 06:30:59 -04: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
Thomas Arendsen Hein
488cd384d8 test-extension.t: use fixed version string instead of current tag
Currently tests break with the current tag being 2.3-rc and tags set by the
user could affect this test, too.
2012-07-19 16:50:52 +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
20d69df9d5 tests: convert a push test to use revsets 2012-07-15 12:43:10 -04: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
Joshua Redstone
2118475aca perf: fix perfcca to work with new casecollisionauditor interface
A recent changeset, 66b3a64f7b5e, modified the caescollisionauditor interface
but did not update perf.py.  This changeset remidies that.
2012-07-18 07:51:20 -07:00
Wagner Bruna
243b1101bd convert: make filemap renames consistently override revision renames
When the source repository had a revision renaming "$new -> $old",
but the filemap a "$old -> $new" rename, the converted revision could
use either $new (deleting the file) or $old (keeping the file) when
getting the file data, depending on the lexicographical order of
those names. So the resulting revision would leave some files
untouched (as expected), but delete others arbitrarely.
2012-07-06 01:14:02 -03: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
Adrian Buehlmann
f1e9744a78 obsolete: add seek to end of file before calling tell (issue3543) 2012-07-16 22:37:44 +02:00
Sune Foldager
e82027e6f3 peer: remove cancopy from peer api; use directly on repo instead 2012-07-13 21:52:37 +02:00
Sune Foldager
7045c35403 peer: introduce canpush and improve error message 2012-07-13 21:52:28 +02:00
Peter Arrenbrecht
ef7b77046e peer: introduce real peer classes
This change separates peer implementations from the repository implementation.
localpeer currently is a simple pass-through to localrepository, except for
legacy calls, which have already been removed from localpeer. This ensures that
the local client code only uses the most modern peer API when talking to local
repos.

Peers have a .local() method which returns either None or the underlying
localrepository (or descendant thereof). Repos have a .peer() method to return
a freshly constructed localpeer. The latter is used by hg.peer(), and also to
allow folks to pass either a peer or a repo to some generic helper methods.
We might want to get rid of .peer() eventually.

The only user of locallegacypeer is debugdiscovery, which uses it to pose as a
pre-setdiscovery client. But we decided to leave the old API defined in
locallegacypeer for clarity and maybe for other uses in the future.

It might be nice to actually define the peer API directly in peer.py as stub
methods. One problem there is, however, that localpeer implements
lock/addchangegroup, whereas the true remote peers implement unbundle.
It might be desireable to get rid of this distinction eventually.
2012-07-13 21:47:06 +02:00
Sune Foldager
ffe56435bf peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.

Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
2012-07-13 21:46:53 +02:00
Augie Fackler
62bcb3f2f9 bookmarks: document behavior of -B/--bookmark in help 2012-07-06 14:12:42 -05:00
Augie Fackler
4441aecdd5 test-bookmarks-pushpull.t: verify correct push -B behavior
I wasn't able to find a test that proved this behavior worked, so I
felt obligated to write a quick test so it won't regress in the
future.
2012-07-06 14:11:58 -05:00
Patrick Mezard
c99c100ff8 debugrevlog: handle numrevs == numfull case (issue3537)
Instead of tracing back with a ZeroDivisionError.
2012-07-11 11:52:42 +02:00