Commit Graph

18858 Commits

Author SHA1 Message Date
Mads Kiilerich
64f616517b unionrepo: read-only operations on a union of two localrepos
unionrepo is just like bundlerepo without bundles.

The implementation is very similar to bundlerepo, but I don't see any obvious
way to generalize it.

Some most obvious use cases for this would be log and diff across local repos,
as a kind of preview of pulls, for instance:

  $ hg -R union:repo1+repo2 heads
  $ hg -R union:repo1+repo2 log -r REPO1REV -r REPO2REV
  $ hg -R union:repo1+repo2 log -r '::REPO1REV-::REPO2REV'
  $ hg -R union:repo1+repo2 log -r 'ancestor(REPO1REV,REPO2REV)'
  $ hg -R union:repo1+repo2 diff -r REPO1REV -r REPO2REV

This is going to be used in RhodeCode, and Bitbucket already uses something
similar. Having a core implementation would be beneficial.
2013-01-18 15:54:09 +01:00
Yuya Nishihara
56f8539ba6 subrepo: fix exception on revert when "all" option is omitted
Since 0f22f83473ea, backout does not set opts['all'], which causes KeyError
at hgsubrepo.revert.
2013-04-15 23:52:57 +09:00
Matt Mackall
ba6ac2be0d histedit: update tests for new intervention framework 2013-04-14 19:05:19 -05:00
Angel Ezquerra
eab5413a57 test-subrepo: add tests for subrepo "storeclean" checks
These tests verify that subrepos are not pushed when their store is clean versus
a given target repository.
2013-03-08 21:50:27 +01:00
Angel Ezquerra
b16687d552 subrepo: do not push mercurial subrepos whose store is clean
This patch stops mercurial from pushing unmodified subrepos. An unmodified
subrepo is one whose store is "clean" versus a given target subrepo.

Note that subrepos may have a clean store versus a target repo but not versus another. This patch handles this scenario by individually keeping track of the state of the store versus all push targets.

Tests will be added on the following revision.
2013-02-16 01:21:40 +01:00
Angel Ezquerra
40ab1ba4c3 subrepo: implement "storeclean" method for mercurial subrepos
The mercurial subrepo "storeclean" method works by calculating a "store hash" of
the repository state and comparing it to a cached store hash. The store hash is
always cached when the repository is cloned from or pushed to a remote
repository, but also on pull as long as the repository already had a clean
store. If the hashes match the store is "clean" versus the selected repository.

Note that this method is currenty unused, but it will be used by a later patch.

The store hash is calculated by hashing several key repository files, such as
the bookmarks file the phaseroots file and the changelog. Note that the hash
comparison is done file by file so that we can exit early if a pair of hashes
do not match. Also the hashes are calculated starting with the file that is
most likely to be smaller upto the file that is more likely to be larger.
2013-02-16 01:18:53 +01:00
Angel Ezquerra
19a754cb08 util: add notindexed optional parameter to makedirs function 2013-02-16 11:44:13 +01:00
Angel Ezquerra
fb9583bfba subrepo: introduce storeclean method
Currently this method is unused and it is not implemented for any specific
subrepo type (it always returns False). It receives a remote repository path
because a repository may have a clean store versus a given repository but not
versus another.
2013-02-16 01:11:20 +01:00
Angel Ezquerra
81aa820bd9 subrepo: introduce storeclean helper functions
These helper functions are currently unused but will be used to implement the
cleanstore method that will be introduced later.
2013-02-16 00:07:00 +01:00
Augie Fackler
be59bb31f7 dispatch: exit with status 1 for an InterventionRequired exception (bc) 2013-02-08 16:17:46 -06:00
Augie Fackler
45ed657bf8 histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc) 2013-02-08 16:27:49 -06:00
Augie Fackler
60b871ef75 rebase: switch from util.Abort to util.InterventionRequired where appropriate (bc) 2013-02-08 16:27:59 -06:00
Augie Fackler
818d095a0a dispatch: catch InterventionRequired and print the message with no prefix 2013-02-08 16:28:24 -06:00
Augie Fackler
91bbcff92c error: introduce new InterventionRequired exception
Future changes will use this type instead of util.Abort for signalling
the user that intervention is required, as in some rebase and histedit
aborts.
2013-02-08 14:26:03 -06:00
Bryan O'Sullivan
8038ef7b7e util: remove unreachable code
Found by Cython.
2013-04-12 19:48:07 -07:00
Bryan O'Sullivan
e2ab8435d3 util: remove no-op assignment
Found by Cython.
2013-04-12 19:33:48 -07:00
Bryan O'Sullivan
4e829e8dd6 merge more evolve stuff away (what?) 2013-04-12 18:49:14 -07:00
Bryan O'Sullivan
fb4f6a8456 synthrepo: add missing import of sys
Found using Cython.
2013-04-12 18:48:02 -07:00
Bryan O'Sullivan
747f253c06 transplant: pass source through to recover 2013-04-12 18:44:22 -07:00
Bryan O'Sullivan
e992dbcedf merge away some failed evolve fat-fingering 2013-04-12 18:35:26 -07:00
Bryan O'Sullivan
4a4e45180d pager: add missing imports of errno and shlex
Found using Cython.
2013-04-12 17:35:56 -07:00
Bryan O'Sullivan
af3ab5c0be largefiles: quiet (and document) undefined name errors (issue3886)
These names were found using Cython; I was completely puzzled until
I searched the rest of the tree. It's icky to mess with another
module's namespace, but ickier yet to do so without a comment :-)
2013-04-12 17:33:24 -07:00
Bryan O'Sullivan
cb3da91764 color: add missing import of error
Found using Cython.
2013-04-12 17:27:09 -07:00
Bryan O'Sullivan
fb050f23a7 repoview: remove more unreachable code
Found using Cython.
2013-04-12 17:25:27 -07:00
Bryan O'Sullivan
426c898bd2 pvec: use the correct name for an identifier
Found using Cython.
2013-04-12 17:20:09 -07:00
Bryan O'Sullivan
273ac980e4 pvec: use the correct name for an identifier
Found using Cython.
2013-04-12 17:20:09 -07:00
Bryan O'Sullivan
f489c0d0c1 repoview: remove unreachable code
Found using Cython.
2013-04-12 17:18:52 -07:00
Bryan O'Sullivan
6bdbf1a461 repoview: remove unreachable code
Found using Cython.
2013-04-12 17:18:52 -07:00
Bryan O'Sullivan
855ee49f38 mail: add missing import of sys
Found using Cython.
2013-04-12 17:17:35 -07:00
Bryan O'Sullivan
e689a5b672 statichttprepo: add missing import of os
Found using Cython.
2013-04-12 17:17:05 -07:00
Bryan O'Sullivan
7fb4e0bf12 worker: add missing import of errno
Found using Cython.
2013-04-12 17:16:37 -07:00
Bryan O'Sullivan
434777d4af histedit: support editing of the first commit (issue3767) 2013-04-12 16:01:18 -07:00
Augie Fackler
bd9e548151 test-commit-amend.t: fix check-code violation from ea36fbf3d5c3 2013-04-12 17:00:42 -04:00
Mads Kiilerich
c7ab477d55 util: improve doc for checkcase 2013-02-11 00:43:12 +01:00
Mads Kiilerich
c7d556777b scheme: don't crash on invalid URLs 2013-04-11 14:41:22 +02:00
Brodie Rao
3d16726725 amend: support amending merge changesets (issue3778) 2013-02-08 21:08:34 +00:00
Bryan O'Sullivan
c538c00399 worker: catch all exceptions, try to exit usefully/safely 2013-04-11 13:30:31 -07:00
Bryan O'Sullivan
7d3941d67f lock: if we fork, ensure that only the parent releases
This prevents us from having a bunch of errant worker processes all try
to release a lock if a problem occurs. (Releasing the lock more than once
is harmless; it's invoking the associated callbacks we want to avoid.)
2013-04-11 13:30:27 -07:00
Mads Kiilerich
c0e7f36590 tag: clarify cryptic error message when tagging null revision 2013-04-11 14:44:22 +02:00
Mads Kiilerich
af3a71e28b setup: make error message for missing Python headers more helpful 2013-04-12 16:55:34 -04:00
Pierre-Yves David
a256234df3 obsolete: ensure all markers have a date
Obsolescence creates a sparse DAG mostly composed of a lot of small independent
chain of markers. Date is the only simple and "reliable" way to sort them. The
existence of a date is now enforced at creation time as I'm more and more
convinced that date will have a key role in obsolescence markers exchange.
2013-02-11 11:20:12 +01:00
Nikolaj Sjujskij
5b84a8b846 zsh_completion: make use of debuglabelcomplete command
Use `debuglabelcomplete` command when populating labels list, instead of
calling `hg` three times: for branches, bookmarks and tags. Do not pass string
being completed to `hg debuglabelcomplete` (as `$words[$CURRENT]`), since it
breaks `_hg_revrange` completion (`--rev 2.5:2.5.<Tab>`) for no apparent
benefit.
Also complete `hg view` with labels, not just tags, and drop unused `_hg_tags`.
2013-04-08 16:51:38 +04:00
Bryan O'Sullivan
562cfc4b72 dirs: use mutable strings internally
perfdirs results for a working dir with 170,000 files:
  Python     638 msec
  C          244
  C+int      192
  C+int+str  168

In the large repo above, the nearly 0.5 second time improvement is
visible in commands like "hg add" and "hg update".

hg add
  Python    1100 msec
  C+int+str  600

hg update (with nothing to do)
  Python    2800 msec
  C+int+str 2240
2013-04-10 15:08:28 -07:00
Bryan O'Sullivan
601384a79a dirs: use mutable integers internally
These integers are not visible to Python code, so this is safe.

perfdirs results for a working dir with 170,000 files:
  Python     638 msec
  C          244
  C+int      192
2013-04-10 15:08:27 -07:00
Bryan O'Sullivan
8f78d582d5 scmutil: rewrite dirs in C, use if available
This is over twice as fast as the Python dirs code. Upcoming changes
will nearly double its speed again.

perfdirs results for a working dir with 170,000 files:
  Python     638 msec
  C          244
2013-04-10 15:08:27 -07:00
Bryan O'Sullivan
4a4a5dde94 scmutil: use new dirs class in dirstate and context
The multiset-of-directories code was open coded in each of these
modules; this change gets rid of the duplication.
2013-04-10 15:08:26 -07:00
Bryan O'Sullivan
c1db508ee8 scmutil: add a dirs class
This encapsulates the "multiset of directories" structures that are
currently open-coded (and duplicated) in both the dirstate and
context modules.

This will be used, and optionally replaced by a C implementation,
in upcoming changes.
2013-04-10 15:08:26 -07:00
Bryan O'Sullivan
00ff38c9c3 scmutil: migrate finddirs from dirstate 2013-04-10 15:08:25 -07:00
Bryan O'Sullivan
283083ca12 merge 2013-04-10 15:05:06 -07:00
Siddharth Agarwal
559322b2a6 manifestmerge: handle workdir removed, remote removed with flags
This can happen when a file with flags is removed or deleted in the working
directory and also not present in m2. The obvious solution is to add a
__delitem__ override to manifestdict that removes the file from flags if
necessary, but that has a significant performance cost in some cases, e.g.
hg status --rev rev1 --rev rev2 <file>.
2013-04-10 12:34:42 -07:00