Commit Graph

4141 Commits

Author SHA1 Message Date
Szymon Wroblewski
f07e68437b splicemap: support paths with spaces in splicemap (issue3844)
Shlex module was used to split line as suggested. Split operates in POSIX mode.
2013-05-08 20:55:56 +02:00
Matt Mackall
28fc779166 merge with stable 2013-05-09 18:34:04 -05:00
Matt Mackall
0cb1d8e0c6 merge with stable 2013-05-09 10:51:03 -05:00
Matt Mackall
0f25695305 merge with stable 2013-05-05 18:51:34 -05:00
Siddharth Agarwal
8e7066e5f2 match: make explicitdir and traversedir None by default
With this, extensions can easily tell when traversedir and/or explicitdir don't
need to be called.
2013-05-03 14:41:58 -07:00
Siddharth Agarwal
1e12630870 inotify: call match.explicitdir
inotify only returns explicit directories matched.
2013-04-28 21:28:31 -07:00
Siddharth Agarwal
45c34a6c9f purge: hook into match.explicitdir and traversedir 2013-04-28 21:27:57 -07:00
Ben Goswami
bf2e9422e6 splicemap: improve error handling when source is subversion (issue2084)
Implemented error handling on splicemap file when source is
subversion (This checks are similar to when source is hg or git).

The revision string is expected to be of svn:<uuid><path>@<number>
format.

the test case has been enhanced to check this format.
2013-04-25 18:01:00 -07:00
Ben Goswami
d334de37cd splicemap: improve error handling when source is git (issue2084)
Implemented similar error handling that is done for hg in an earlier revision.
These are:
   a. add checking for splicemap file format
   b. add checking for each revision string formats
2013-04-25 16:02:58 -07:00
Ben Goswami
8afeeb7248 splicemap: improve error handling when source is hg (issue2084)
1. Introduced 2 levels of error handling for splicemap files
   a. Check the splicemap file for rules which are same across different
      types of source repos.  This is done through enhancing parsesplicemap
      function
   b. Check revision string formats.  Each repo may have their own format.
      This is done usign checkrevformat function
   c. Implemented the above two for hg
2013-04-25 11:50:26 -07:00
Ben Goswami
e47f0885b5 splicemap: move parsesplicemap to convcmd.py (issue2084)
parsesplicemap is only referenced from convcmd.py
This move is necessary to enable other changes related to
this issue
2013-04-24 18:26:37 -07:00
Mads Kiilerich
886d6922c4 record: ignore trailing content when parsing patches - introduce 'other' lines
This makes record work more like import which ignores for instance mail footers
in a patch file.

This also makes it possible for TortoiseHg to preview unapplied patches
containing such footers.
2012-06-13 23:06:34 +02:00
Mads Kiilerich
dbfffc0abf record: abort on malformed patches instead of crashing 2013-04-11 19:03:33 +02: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
Bryan O'Sullivan
747f253c06 transplant: pass source through to recover 2013-04-12 18:44:22 -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
6bdbf1a461 repoview: remove unreachable code
Found using Cython.
2013-04-12 17:18:52 -07:00
Bryan O'Sullivan
434777d4af histedit: support editing of the first commit (issue3767) 2013-04-12 16:01:18 -07:00
Mads Kiilerich
c7d556777b scheme: don't crash on invalid URLs 2013-04-11 14:41:22 +02:00
FUJIWARA Katsunori
3a3aca3c72 smtp: verify the certificate of the SMTP server for STARTTLS/SMTPS
Before this patch, the certificate of the SMTP server for STARTTLS or
SMTPS isn't verified.

This may cause man-in-the-middle security problem (stealing
authentication information), even though SMTP channel itself is
encrypted by SSL.

When "[smtp] tls" is configured as "smtps" or "starttls", this patch:

  - uses classes introduced by preceding patches instead of "SMTP" or
    "SMTP_SSL" of smtplib, and

  - verifies the certificate of the SMTP server, if "[smtp]
    verifycert" is configured as other than False

"[smtp] verifycert" can be configured in 3 levels:

  - "strict":

    This verifies peer certificate, and aborts if:

      - peer certification is not valid, or
      - no configuration in "[hostfingerprints]" and "[web] cacerts"

    This is default value of "[smtp] verifycert" for security.

  - "loose":

    This verifies peer certificate, and aborts if peer certification is
    not valid.

    This just shows warning message ("certificate not verified"), if
    there is no configuration in "[hostfingerprints]" and "[web]
    cacerts".

    This is as same as verification for HTTPS connection.

  - False(no verification):

    Peer certificate is not verified.

    This is as same as the behavior before this patch series.

"hg email --insecure" uses "loose" level, and ignores "[web] cacerts"
as same as push/pull/etc... with --insecure.

Ignoring "[web] cacerts" configuration for "hg email --insecure" is
already done in "dispatch._dispatch()" by looking "insecure" up in the
table of command options.
2013-03-26 02:28:10 +09:00
Bryan O'Sullivan
e905def78f blackbox: defer opening a log file until needed (issue3869)
Previously, we opened the log file when creating a repo object. This
was inefficient (not all repo creation is going to result in a need to
log something), but more importantly it broke subrepo updates when used
on NFS.

* perform an update in the master repo that triggers a subrepo clone

* empty subrepo already exists, and has an open, empty blackbox.log file
  due to it being opened eagerly/prematurely

* hg decides to blow away the skeletal subrepo (see use of shutil.rmtree
  in subrepo._get)

* we crash, due to NFS treating a delete of an open file as really a
  rename to a hidden ".nfs" file

Now that we open the blackbox log file on demand, no file exists at the
time the empty subrepo is deleted, so the above problem does not occur.
2013-03-26 16:27:51 -07:00
Simon Heimberg
0f30974d2c color: drop unnecessary global statement 2013-03-21 18:16:49 +01:00
Simon Heimberg
9e6ca20cff repo: repo isolation, do not pass on repo.ui for creating new repos
A repo should not get the configuration from an other repo, so create it with
the global configuration in repo.baseui.
This is done too when recreating a repo. The repo configuration is reread
anyway. And now deleted repo configuration does not persist.
2012-10-10 21:55:49 +02:00
Constantine Linnick
4d22c22a01 convert: add closesort algorithm to mercurial sources
If you actively work with branches, sometimes you need to close old branches
which last commited hundreds revisions ago. After close you will see long
lines in graph visually spoiling history. This sort only moves closed
revisions as close as possible to parents and does not increase storage size
as datesort do.
2013-03-24 00:06:52 +07:00
Bryan O'Sullivan
68de7be6ca hgk: fix a pyflakes error 2013-03-25 16:57:36 -07:00
Siddharth Agarwal
a91711a512 largefiles: fix _always for match overrides
Upcoming patches will speed dirstate.walk up by not filtering based on the
match function when match.always() is True. For that to work, match.always()
needs to be accurate. Previously it wasn't so for largefiles.
2013-03-25 14:22:34 -07:00
Bryan O'Sullivan
15ac9d5048 blackbox: account for another source of errors 2013-03-22 10:56:55 -07:00
Andrew Shadura
2c0de232d6 hgk: add support for phases
Add support for phases. Update tests.
2013-03-22 09:19:41 -07:00
Bryan O'Sullivan
ec76ade165 blackbox: use util.getuser for portability
On Windows, our implementation is more robust than Python's version.
2013-03-20 13:40:06 -07:00
Bryan O'Sullivan
c6e69fe607 blackbox: prevent failed I/O from causing hg to abort
Instead, we simply print a warning message if opening the blackbox log
file fails, or if writing to it fails.
2013-03-20 13:40:05 -07:00
Siddharth Agarwal
b2140786db largefiles: don't query the dirstate for key None
lfutil.splitstandin(f) can be None, and we query the dirstate for that without
checking if it is. This will cause problems with the upcoming move to critbit-
based dicts, since they only support strings as keys.
2013-03-19 13:49:34 -07:00
Durham Goode
474ac2b31e rebase: fix --collapse when a file was added then removed
When a series of commits first adds a file and then removes it,
hg rebase --collapse prompts whether to keep the file or delete it. This is
due to it reusing the branch merge code. In a noninteractive terminal it
defaults to keeping the file, which results in a collapsed commit that is
has a file that should be deleted. This bug resulted in developers accidentally
commiting unintentional changes to our repo twice today, so it's fairly
important to get fixed.

This change allows rebase --collapse to tell the merge code to accept the
latest version every time without prompting.

Adds a test as well.
2013-03-15 11:23:29 -07:00
Bryan O'Sullivan
6c6b0d29a3 merge with crew-stable 2013-03-12 10:43:59 -07:00
Durham Goode
83c3af4210 rebase: restore active bookmark after rebase --continue
When a rebase has conflicts and the user uses rebase --continue, the previously
active bookmark was not being made active once again. With this change that
bookmark is made active again, just as if the rebase had never been interrupted.

This changes the rebasestate file format, but should handle old formats correctly.
Since the file is transient, this is even less of a problem.

Adds a test to verify the new behavior. I manually tested continuing rebases
with and without an active bookmark, and with and without being on the bookmark
being rebased.
2013-03-11 15:37:28 -07:00
Durham Goode
83b3faf2ec strip: make --keep option not set all dirstate times to 0
hg strip -k was using dirstate.rebuild() which reset all the dirstate
entries timestamps to 0.  This meant that the next time hg status was
run every file was considered to be 'unsure', which caused it to do
expensive read operations on every filelog. On a repo with >150,000
files it took 70 seconds when everything was in memory.  From a cold
cache it took several minutes.

The fix is to only reset files that have changed between the working
context and the destination context.

For reference, --keep means the working directory is left alone during
the strip. We have users wanting to use this operation to store their
work-in-progress as a commit on a branch while they go work on another
branch, then come back later and be able to uncommit that work and
continue working.  They currently use 'git reset HARD^' to accomplish
this in git.
2013-03-06 20:13:09 -08:00
Mads Kiilerich
265b736027 largefiles: remove wrong comment on standin matcher and code for creating dirs
The existence of these directories could not be relied on anyway and all
dependencies on them should have been removed.
2013-02-28 14:05:15 +01:00
Mads Kiilerich
00a100f5a5 merge with stable 2013-02-28 14:51:59 +01:00
Mads Kiilerich
335985feed largefiles: updatelfiles should use working dir standins, not standins from p1
This makes a difference when working directory is dirty, especially when
merging with a revision for which we don't have largefiles.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
090ace70e1 largefiles: simplify cachelfiles - don't spend a lot of time checking hashes
cachelfiles jumped through loops to handle merges and modified files ... but it
did apparently no longer have a valid reason to do so. It should just always
make sure that the largefiles referenced from the standins are present - no
matter which actual largefile is stored in the working directory. If there is
no standin then there is nothing to fetch.

The old code usually verified the hash of all largefiles every time this
function was invoked - for examply by 'update'.

This change makes a trivial noop update 5-10 seconds faster on our repo (with
the other 50% spent doing another unnecessary hashing of all largefiles).
2013-02-28 13:45:18 +01:00
Mads Kiilerich
1d9aca9cb3 largefiles: don't let update leave wrong largefiles in wd if fetch fails
Situations where a largefile for some reason wasn't available sometimes caused
wrong largefile content and state. It has mostly been seen when interrupting
download of largefiles ... and when introducing programming errors.

Instead we now make sure to delete the old and wrong largefile. A missing file
is a well-known error condition and much more reasonable way to handle the
situation.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
68d046f103 largefiles: missing largefiles should not be committed as removed
Largefiles can easily become missing - for example if it simply isn't available
or the download fail. It might even be convenient to be able to work that way
in some cases.

But commiting missing largefiles as if they had been 'hg remove'd is plain wrong.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
8c5a6710d0 largefiles: don't assume that .hg/largefiles/ still exists
It might not have been created and it might have been removed.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
34d52d8c6e largefiles: getstandinmatcher should not depend on existence of directories
Looking for a (potentially empty) directory was not reliable - both because it
is a reasonable assumption that empty directories can be removed and because it
wasn't created in all cases ... such as when pulling to an existing repository.
2013-02-28 13:45:18 +01:00
Mads Kiilerich
d00a3f9b96 largefiles: fix download of largefiles from an empty list of changesets
The empty list was interpreted as all revisions - just like None is.

The empty list is now handled explicitly.
2013-02-28 13:44:24 +01:00
Mads Kiilerich
6e16465965 largefiles: fix off-by-one error on pull --all-largefiles
Test output is changed in a case where one revision was pulled, but because of
the off-by-one error it thought that 0 revisions were pulled ... and because of
another bug it thus (tried to) fetch largefiles for all revisions.

After this change it no longer reports failure when it failed while trying to
fetch largefiles it shouldn't fetch.  Largefiles that it shouldn't fetch but
managed to fetch anyway will now correctly be missing later on.

This change thus resolves some of unexplained test output introduced in
8664d9900884.
2013-02-28 13:44:22 +01:00
Matt Mackall
ce5cc60bf7 convert: stabilize cvsps commitid sort order 2013-02-22 16:40:27 -06:00
Matt Mackall
fb3c5e53c4 pager: catch ctrl-c on exit (issue3834) 2013-02-22 15:17:33 -06:00
Na'Tosha Bard
f1bd9d017e largefiles: don't cache largefiles for pulled heads by default
After discussion, we've agreed that largefiles for newly pulled heads should
not be cached by default.  The use case for this is using largefiles repos
with multiple remote servers (and therefore multiple remote largefiles caches),
where users will be pulling from non-default locations on a regular basis.  We
think this use case will be significantly less common than the use case where
all largefiles are stored on the same central server, so the default should be
no caching.

The old behavior can be obtained by passing the --cache-largefiles flag to
pull.
2013-02-09 21:07:42 +00:00
Siddharth Agarwal
afbf9327e6 rebase: derive node from target rev (issue3802)
dest.rev() is the same as target when a new rebase is run, but dest
isn't set when rebase --continue is run. Bug introduced in 97aaac321ced,
which fixed issue3685.
2013-02-03 14:26:39 -08:00
Pierre-Yves David
5b37f126e0 rebase: mention --rev in the help
This changeset adds a small mention of it in the help to prevent
confusion. This small addition references online help that is easier to
update and improve at release time.

Following Wagner Bruna's advice, this is added in a plain new paragraph
to not invalidate current translation this close to the release.
2013-02-01 02:01:11 +01:00
Kevin Bullock
6246126341 rebase: mention phases in the help
Mention that Mercurial helps you not do what you've just been warned not
to do, with a reference to the 'phases' help topic (not the 'phase'
command help).

Thanks to Pierre-Yves David <pierre-yves.david@ens-lyon.org> for
motivating this change and Wagner Bruna
<wagner.bruna+mercurial@gmail.com> for advising on how to do it in an
i18n-friendly way.
2013-01-31 20:01:26 -06:00
Siddharth Agarwal
eb2c7139a5 rebase: delete divergent bookmarks on destination (issue3685)
Similar to merge, divergent bookmarks are only deleted when the bookmark is on
the destination parent.
2013-01-30 16:08:32 -08:00
Siddharth Agarwal
dd1e6af7ac rebase: remove bogus nullmerge check in updatebookmarks
nstate[v] is a node, not an int, and the nullmerge check was done while
building nstate anyway.
2013-01-30 17:49:54 -08:00
Augie Fackler
404721d3a3 histedit: prevent parent guessed via --outgoing from being a revset (issue3770)
If the binary hash of the parent node guessed via --outgoing happened
to contain a special revset character (":" was specified in the bug),
the revset parser would abort. Hexlifying the node before passing it
to the revsingle call should fix that.
2013-01-30 10:57:28 -05:00
Mads Kiilerich
f66f2bb471 largefiles: fix cat when using relative paths from subdirectory 2013-01-25 18:20:13 +01:00
Mads Kiilerich
c066baf66c largefiles: fix commit when using relative paths from subdirectory
Remove cwd handling from getstandinmatcher - it did not belong there, as proven
by the tests.
2013-01-25 16:59:34 +01:00
Mads Kiilerich
2ec95abd3b largefiles: allow use of urls with #revision
largefiles tried to create a peer directly with the specified url. That caused
  abort: unsupported URL component: "..."
if a revision was specified in the url.

The branch name do not matter for largefiles' use of remote peers. Largefiles
will be shared among all branches anyway.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
4b17e20f7c largefiles: don't verify largefile hashes on servers when processing statlfile
When changesets referencing largefiles are pushed then the corresponding
largefiles will be pushed too - unless the target already has them. The client
will use statlfile to make sure it only sends largefiles that the target
doesn't have. The server would however on every statlfile check that the
content of the largefile had the expected hash. What should be cheap thus
became an expensive operation that trashed the disk and the cache.

Largefile hashes are already checked by putlfile before being stored on the
server. A server should thus be able to keep its largefile store free of
errors - even more than it can keep revlogs free of errors. Verification should
happen when running 'hg verify' locally on the server. Rehashing every
largefile on every remote stat is too expensive.

Clients will also stat lfiles before downloading them. When the server verified
the hash in stat it meant that it had to read the file twice to serve it.

With this change the server will assume its own hashes are ok without checking
them on every statlfile.

Some consequences of this change:
- in case of server side corruption the problem will be detected by the
  existing check on the client side - not on server side
- clients that could upload an uncorrupted largefile when pushing will no
  longer magically heal the server (and break hardlinks) - a client will now
  only upload its uncorrupted files after the corrupted file has been removed
  on the server side
- client side verify will no longer report corruption in files it doesn't have

(Issue3123 discussed related problems - and how they have been fixed.)
2013-01-28 15:19:44 +01:00
Mads Kiilerich
46ab1da155 largefiles: verify all files in each revision and report errors in any revision
Verify used 'any' and would stop verifying after the first failure in each
changeset.

The exit code only reported the result from the last changeset.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
6608184763 largefiles: adapt remotestore._getfile to batched statlfile
6fb54510b150 introduced batching of statlfile, but not all codepaths got
converted.

_getfile gave _stat garbage and got garbage back. The garbage didn't match the
expected error codes and was thus interpreted as success. It could thus end up
trying to fetch a largefile that didn't exist.

Instead we now pass _stat valid input and handle both correct and invalid
output correctly.

This makes the code work as intended ... but it would probably be better if it
didn't abort on missing largefiles, just like it happened to do before.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
30af46c496 largefiles: don't allow corruption to propagate after detection
basestore.get uses util.atomictempfile when checking and receiving a new
largefile ... but the close/discard logic was too clever for largefiles.
Largefiles relied on being able to discard the file and thus prevent it from
being written to the store. That was however too brittle. lfutil.copyandhash
closes the infile after writing to it ... with a 'blecch' comment. The discard
was thus a silent noop, and as a result of that corruption would be detected
... and then the corrupted files would be used anyway.

Instead we now use a tmp file and rename or unlink it after validating it.

A better solution should be implemented ... but not now.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
896f340423 largefiles: adapt verify to batched remote statlfile (issue3780)
6fb54510b150 introduced batching of statlfile, but not all codepaths got
converted.

'hg verify' with a remotestore could thus crash with
  TypeError: 'builtin_function_or_method' object is not iterable

Also, the 'hash' variable was used without assigning to it. Don't use variable
names that collide with Python built-in functions. Instead we use 'expecthash'
as in localstore.

The tests for this issue covers an untested area. The tests happens to also
reveal incorrect attempts at getting non-existing largefiles, bad server side
handling of that, and corruption issues - all to be fixed later.
2013-01-28 15:19:44 +01:00
Mads Kiilerich
0abb17e594 largefiles: let wirestore._stat return stats as expected by remotestore verify
- preparing for fixing verify crash.
2013-01-28 15:19:44 +01:00
Wagner Bruna
30efeaefbe largefiles: enhance error message to make it more i18n-friendly 2013-01-21 13:42:04 -02:00
Benoit Boissinot
8f1400147f largefiles: fix largefiles+subrepo update (issue3752)
Override updaterepo() instead of individual methods that may not be called for
each subrepo. Add test.
Based on patch from Matt Harbison.

Changes the order of update-related messages (now largefiles comes before the
global status).
2013-01-23 00:51:53 +01:00
Pierre-Yves David
b3f0e4c581 rebase: properly handle unrebased revision between rebased one
With rebase taking multiple roots it is possible to have revision in the "rebase
domain" not rebased themself. We do not want rebased revision above them to be
detached. We want such revision to be rebased on the nearest rebased ancestors.
This allows to preserve the topology of the rebase set as much a possible

To achieve this we introduce a new state `revignored` which informs
`defineparents` of the situation.

The test in `test-rebase-obsolete.t` was actually wrote and his now fixed.
2013-01-18 23:41:48 +01:00
Pierre-Yves David
5820a2b31c rebase: lose the comparison to nullmerge
For a proper behavior of the `--rev` revision we will need another possible
state for revision ignored by rebase. We alter the comparison to `nullmerge`
to match this future lower state too.
2013-01-18 23:21:32 +01:00
Pierre-Yves David
b24e3849df rebase: do not invent successor to skipped changeset
When rebase results in an empty a changeset it is "skipped" and no related
changeset is created at all. When we added obsolescence support to rebase (in
cee0a253a56c) it seemed a good idea to use its parent successor as the
successors for such dropped changesets. (see old version of the altered test).
This option was chosen because it seems a good way to hint about were the
dropped changeset "intended" to be. Such hint would have been used by automatic
evolution mechanism to rebase potential unstable children.

However, field testing of this version are not conclusive. It very often leads
to the creation of (totally unfounded) evolution divergence. This changeset
changes this behavior and mark skipped changesets as pruned (obsolete without
successors). This prevents the issue and seems semantically better probably a
win for obsolescence reading tool.

See example bellow for details:

User Babar has five changesets of interest:
- O, its current base of development.
- U, the new upstream
- A and C, some development changesets
- B another development changeset independent from A

    O - A - B - C
      \
        U

Babar decides that B is more critical than the A and C and rebase it first

  $ hg rebase --rev B --dest U

B is now obsolete (in lower case bellow). Rebase result, B', is its
successors.(note, C is unstable)

    O - A - b - C
      \
        U - B'

Babar is now done with B', and want to rebase the rest of its history:

  $ hg rebase --source A --dest B'


hg rebase process A, B and C. B is skipped as all its changes are already contained
in B'.

    O - U - B' - A' - C'

Babar have the expected result graph wise, obsolescence marker are as follow:

    B -> B' (from first rebase)
    A -> A' (from second rebase)
    C -> C' (from second rebase)
    B -> ?? (from second rebase)

Before this changeset, the last marker is `B -> A'`. This cause two issues:

- This is semantically wrong. B have nothing to do with A'
- B has now two successors sets: (B',) and (A',). We detect a divergent
  rewriting. The B' and A' are reported as "divergent" to Babar, confusion
  ensues. In addition such divergent situation (divergent changeset are children
  to each other) is tricky to solve.

With this changeset the last marker is `B -> ø`:

- This is semantically better.
- B has a single successors set (B',)

This scenario is added to the tests suite.
2013-01-18 14:15:32 +01:00
Bryan O'Sullivan
9b64f1d6bd blackbox: fix copyright 2013-02-13 10:54:52 -08:00
Bryan O'Sullivan
55a5166e90 blackbox: fix a failing pyflakes test 2013-02-12 16:02:35 -08:00
Durham Goode
cf493e6ded blackbox: adds a 'blackbox' command for viewing recent logs
Adds a 'hg blackbox' command for viewing the latest entries in the blackbox log.
By default it shows the last 10 entries, but -l allows the user to specify.
2013-02-09 09:09:46 -08:00
Durham Goode
4add84adea blackbox: adds a blackbox extension
Adds a blackbox extension that listens to ui.log() and writes the messages to
.hg/blackbox.log. Future commits will use ui.log() to log commands, unhandled
exceptions, incoming changes, and hooks.  The extension defaults to logging
everything, but can be configured via blackbox.track to only log certain events.
Log lines are of the format:  "date time user> message"

Example log line:
2013/02/09 08:35:19 durham> 1 incoming changes - new heads: d84ced58aaa
2013-02-12 14:08:33 -08:00
Pierre-Yves David
853b87cfc0 mq: comply with filtering when injecting fake tags (issue3812)
mq was injecting fake tags whenever the revisions were accessible
to the filtering level.

This issue impacts hgweb since it's common to have "secret" mq
patches. As secret changesets are filtered by hgweb, the tags
computation could break.
2013-02-11 16:21:48 +01:00
Mads Kiilerich
9f7a8fb2c4 factotum: fix urllib2 import so it no longer relies on a demandimport bug
demandimport will do that urllib2 can be imported 'from mercurial' even though
it doesn't exist there.
2013-02-10 18:26:04 +01:00
Mads Kiilerich
5787baee50 spelling: fix some minor issues found by spell checker 2013-02-10 18:24:29 +01:00
Na'Tosha Bard
7b4ce40b7d largefiles: fix test and check code 2013-02-09 16:02:01 +00:00
Simon Heimberg
d394522225 histedit: always abort with same message when working dir is wrong.
Using only one message makes live easier for translators. The clearer
error message was supposed by Augie Fackler.
2013-08-03 16:40:13 +02:00
Simon Heimberg
6e94c23bab histedit: report when revisions to edit are not ancestors of working dir
Editing the history only is possible when the working dir is a descendant of
the revisions to edit. When this happens explain it by writing
  abort: %s is not an ancestor of working directory
2013-08-03 16:37:17 +02:00
Siddharth Agarwal
ace5cac25b manifestmerge: pass in branchmerge and force separately
This will be used in an upcoming patch.
2013-02-08 15:23:23 +00:00
Na'Tosha Bard
3d65ebe9c1 largefiles: make caching largefiles message more explicit
In some cases, caching largefiles may take a long time (if the user has
pulled a lot of new heads).  This patch makes it more clear what is happening,
by showing the number of heads we are caching largefiles for.
2013-02-09 15:08:21 +00:00
Na'Tosha Bard
5cbae337c9 largefiles: document behavior of caching largefiles for new heads 2013-02-09 15:25:46 +00:00
Mads Kiilerich
1f565a1b35 largefiles: docstrings for verify methods 2013-02-08 13:08:25 +01:00
Mads Kiilerich
e9a72ba5f1 largefiles: fold oddly named _verify into remotestore.exists 2013-02-08 13:00:08 +01:00
Augie Fackler
5c8acaf5b4 git convert: some versions of git use fatal: instead of error:
I saw this behavior with git 1.7.12 on my Mac.
2013-02-08 07:09:48 -06:00
Ross Lagerwall
cb8603510f convert/git: catch errors from modern git-ls-remote (issue3428)
Since git v1.7.8.2-327-g926f1dd (the change was first released in git
1.7.10), git does not return non-zero when "git ls-remote --tags ..."
is run and the repository is damaged. This causes the "damaged
repository with missing commit" test in test-convert-git.t to
unexpectedly succeed.

Fix by aborting if git outputs any lines beginning with "error:",
which required adding some subprocess use in convert/git.py.
2013-02-08 08:02:57 -06:00
Bryan O'Sullivan
fb3cb499e6 Merge crew-stable into crew 2013-02-04 11:42:10 -08:00
Mads Kiilerich
52235c623d largefiles: make verify --lfa and --lfc work without --large
The slightly obscure --lfa and --lfc only worked as modifiers to --large and
could be combined. The documentation was however not clear what they did.

Instead they now imply --large and the description is updated.
2013-01-24 23:57:44 +01:00
Mads Kiilerich
7251dc2f89 largefiles: verify status should be written as status, not as write
Make 'hg verify --large -q' quiet when no errors.
2013-02-04 02:46:53 +01:00
Mads Kiilerich
293a08a6ab largefiles: report localstore errors with single line warnings messages
The actual hash is also not relevant to report.

This makes verify output with multiple failures easier to process.
2013-02-04 02:46:53 +01:00
Mads Kiilerich
ee476759ff merge: delay debug messages for merge actions
Show messages at a point where the actions have been sorted, thus preparing for
backout of 14f4258e3526.

This makes manifestmerge more of a silent operation, just like 'copies' is.

Indent 'preserving' messages to make them subordinate to the action logging so
they fit in the new context. (The 'preserving' messages are quite redundant and
could also be removed completely.)
2013-01-24 23:57:44 +01:00
Mads Kiilerich
3da557a087 merge: make all action tuples have the same length - keep args as tuple 2013-01-24 23:57:44 +01:00
Pierre-Yves David
f52bcf462a histedit: proper phase conservation (issue3724)
Before this changeset, histedit created all new changesets according
phases.new-commit option without any regards for the phases of the original
changesets.

This changeset fix that using the phase of rewritten changeset to decide the
phase of the resulting changeset. In case of reordering or folding, we keep
secret item secret as it seems the safer path.

temporary commit creation are not affected. They are head only and stripped at
the end of the histedit.

As for the resolution of issue3681 (obsolescence cycle prevention), we do not
handle changesets created by edit command.
2013-01-16 19:21:03 +01:00
Pierre-Yves David
5bda497c6d histedit: record histedit source (issue3681)
Have histedit record the hex of the original changeset as already done by:
- graft
- commit --amend
- rebase

My main motivation for adding this is to prevent the creation of obsolescence cycle
(see issue3681).

Note that commit created during edit are not affected yet.
2013-01-16 19:14:22 +01:00
Pierre-Yves David
e9b9dbf10f histedit: factor most commit creation in a function
Later commits add two important items to histedit:
- Obsolescence cycle prevention
- Proper phase conservation

Those logics must be applied to all simple operations (pick, edit, mess) and
will require verbose code.

So we introduce a new function that will provide an entry point for this new.
logic.

The function build a closure to have a clear distinction between commit
arguments and data provided to the function to fulfil its logic.
2013-01-16 19:11:06 +01:00
Pierre-Yves David
7e632ae757 rebase: support multiple roots for rebaseset
We have all the necessary mechanism to rebase a set with multiple roots, we only
needed a proper handling of this case we preparing and concluding the rebase.
This changeset des that.

Rebase set with multiple root allows some awesome usage of rebase like:

- rebase all your draft on lastest upstream

  hg rebase --dest @ --rev 'draft()'

- exclusion of specific changeset during rebase

  hg rebase --rev '42:: - author(Babar)'

-  rebase a set of revision were multiple roots are later merged

  hg rebase --rev '(18+42)::'
2013-01-17 00:35:01 +01:00
Mads Kiilerich
dd30593de7 refactoring: use unlinkpath with ignoremissing 2013-01-15 23:30:10 +01:00
Mads Kiilerich
65e8a6dd50 convert: make toposort order stable when multiple orderings are possible
The output of some tests are changed. Not necessarily to the better, just other
valid permutations.
2012-12-13 23:15:51 +01:00
Mads Kiilerich
41b6d5130f convert: report cvsps branchpoints sorted 2013-01-15 02:59:14 +01:00
Mads Kiilerich
0e2ceeaa5d convert: process subversion branch in a sorted order 2013-01-15 02:59:14 +01:00
Mads Kiilerich
527f4a6941 convert: process missing branches in sorted order 2013-01-15 02:59:14 +01:00
Mads Kiilerich
52b725744f convert: process splicemap in sorted order 2013-01-15 02:59:14 +01:00
Mads Kiilerich
4f5178beb0 mq: stabilize update after strip of parent revision
Strip will (if it updates) update to the parent of revs[0], where revs are the
roots of the tree that is stripped.

When revs was list(set) it was thus undefined which root parent it would update
to. With sorted(set) it is at least stable what it updates to. (But it is very
possible that another more useful and predictable behaviour could be defined
... such as updating to the tip-most surviving wd ancestor.)
2013-01-15 02:59:13 +01:00
Mads Kiilerich
b76126725e histedit: process bookmarks in sorted order 2012-12-12 02:38:14 +01:00
Mads Kiilerich
3d26010623 churn: sort users with same churn by name
This makes the output order well-defined and improves code readability.
2012-12-12 02:38:14 +01:00
Mads Kiilerich
99450fc446 largefiles: upload files in sorted order 2012-12-12 02:38:14 +01:00
Mads Kiilerich
2d6545f8b6 subrepos: process subrepos in sorted order
Add sorted() in places found by testing with PYTHONHASHSEED=random and code
inspection.

An alternative to sprinkling sorted() all over would be to change substate to a
custom dict with sorted iterators...
2012-12-12 02:38:14 +01:00
Mads Kiilerich
d913c8547f mq: checktoppatch should only check if p1 is qtip
There is no way qtip in p2 could be used for anything, and there is thus no
reason to check and accept it.
2013-01-15 01:05:12 +01:00
Mads Kiilerich
60f82115fc mq: fix qpop of working directory parent patch when not at qtip
mq assumed that it had to update from qtip to qparent, and instead of updating
from where it was it failed with:
  abort: working directory revision is not qtip
2013-01-15 01:05:12 +01:00
Mads Kiilerich
9692d4642d largefiles: make log match largefiles in the non-standin location too
Yet another match hack.
2013-01-15 01:05:12 +01:00
Kevin Bullock
bd7b56e105 merge with stable 2013-01-14 10:17:06 -06:00
FUJIWARA Katsunori
573ec722a6 histedit: correct the number of added revisions in online help
In the context of help document on which this patch focuses, the
example repository, which is source of cloning, should be already
histedit-ed, and contain only 3 revisions (rev # 0 to 2). So, not 3,
but 4 revisions should be added to the destination repository of
cloning, if it contains 7 revisions (rev # 0 to 6).

This patch also adds modifier "histedit-ed" to "example repository",
to make context clear.
2013-01-14 23:14:45 +09:00
FUJIWARA Katsunori
75da74f62e histedit: correct changeset IDs in online help
There is no '633536316234' revision in the example repository. It
should be 'c561b4e977df', according to the revisions in it and
explanation in help document.
2013-01-14 23:14:45 +09:00
FUJIWARA Katsunori
9fd6562bca convert: correct 'hooks' section name in online help
The section name for hooks is not 'hook', but 'hooks'.
2013-01-14 23:14:45 +09:00
Mads Kiilerich
79e0196dc6 largefiles: make update with backup files in .hglf slightly less broken
Largefiles update would try to copy f to f.orig if there was a .hglf/f.orig .
That is in many many ways very very wrong, but it also caused an abort if f
didn't exist.

Now it only tries to copy f if it exists.
2013-01-10 15:33:14 +01:00
Benoit Boissinot
12b2b140f5 zeroconf: use port from server instead of picking port from config (issue3746)
In order to get the port, wrap create server instead of
hgweb_mod/hgwebdir_mod.
2012-12-30 19:19:52 +01:00
Mads Kiilerich
dfd7d10cbf largefiles: fix update from a merge with removed files
A situation with this case could happen after interrupting an update. Update
would fail with:
  abort: No such file or directory: $TESTTMP/f/.hglf/sub2/large6

Update from a merge without using clean is not possible anyway, so this patch
takes a step in the right direction so it gets as far as reporting the right
error.
2013-01-11 16:30:29 +01:00
Mads Kiilerich
19813fa421 largefiles: fix revert removing a largefile from a merge
Before revert could fail with:
  abort: .hglf/large@33fdd332ec: not found in manifest!

The LookupError will now be caught and handled correctly.
2013-01-11 16:30:29 +01:00
Mads Kiilerich
5096819efc largefiles: remove unused proto.refuseclient code
Should have been removed with other pre-1.9 code in 416c0b8e6104.
2013-01-11 16:30:29 +01:00
Augie Fackler
2986e3abf8 Merge with stable. 2013-01-10 09:43:28 -05:00
Sean Farley
96729d25e1 color: add template label function 2012-12-28 19:25:10 -06:00
Idan Kamara
ba14804c98 record: remove unused import 2013-01-09 21:13:52 +02:00
Idan Kamara
547e15c84f cvsps: fix indentation 2013-01-09 21:11:00 +02:00
Pierre-Yves David
d625ea9d23 clfilter: drop unnecessary explicit filtering on histedit
Hidden changeset filtering is now done at repo level. The orphaned
children computation will not include any (unless you add --hidden).
2012-12-24 12:00:08 +01:00
Mads Kiilerich
82c7e260df largefiles: don't walk through all ignored files
Problem: 'hg status' with largefiles enabled would walk through all the files
that .hgignore said should be ignored. That made it slow if a lot of files were
.hgignored or the cache was cold.

It seems like there was a reason to this, but other improvements has rendered
this unnecessary.

Solution: .hgignore is now only ignored when that is requested (--ignore).

This is a minimal 'stable' change. There is room for other improvement.
2012-12-13 19:19:06 +01:00
Mads Kiilerich
96d2cbf93b largefiles revert: update lfdirstate with result from first cleanliness check
Largefiles revert do for some reason have two lfdirstates and lfdirstatestatus
invocations in one function. The result from the first lfdirstate check was
however not written back to the lfdirstate, and some files was thus checked
twice.
2012-12-13 19:19:06 +01:00
Mads Kiilerich
f9eedbbdd4 largefiles status: update lfdirstate with result from cleanliness check
Problem: 'hg status' kept checking largefiles with an unknown state until some
other command wrote the updated dirstate.

Solution: Add missing lfdirstate.write().
2012-12-13 19:19:06 +01:00
Pierre-Yves David
d23fadbe9a clfilter: drop unnecessary explicit filtering on rebase
Hidden changeset filtering is now done at repo level. The rebaseset
computation will not include any (unless you add --hidden).
2012-12-04 14:58:19 +01:00
Pierre-Yves David
a1985448ad clfilter: enforce hidden changeset globally
The dispatch code now enables filtering of "hidden" changesets globally. The
filter is installed before command and extension invocation. The `--hidden`
switch is now global and disables this filtering for any command.

Code in log dedicated to changeset exclusion is removed as this global filtering
has the same effect.
2013-01-08 20:37:37 +01:00
Denis Laxalde
b706c87e50 record: use patch.diffopts to account for user diffopts
This allows user defined diff options (e.g. showfunc) to be accounted for
when using record. A test has been updated accordingly.
2013-01-08 21:16:39 +01:00
Bryan O'Sullivan
7b68f267c0 convert: fix most test-check-code-hg violations in cvsps code 2013-01-08 16:26:52 -08:00
Frank Kingswood
41de1ef081 cvsps: use commitids (when present) to detect changesets
Simplify core logic by no longer attempting to work around missing
class attributes. Instead always generate the attributes and ignore
the cache if the attributes are missing
2013-01-08 20:11:20 +00:00
Levi Bard
5ac6c21477 largefiles: commit directories that only contain largefiles (issue3548)
If we pass a directory to commit whose only commitable files
are largefiles, the core commit code aborts before finding
the largefiles.
So we do the following:
For directories that only have largefiles as matches,
we explicitly add the largefiles to the matchlist and remove
the directory.
In other cases, we leave the match list unmodified.
2012-12-10 14:58:42 +01:00
Pierre-Yves David
39909ce228 rebase: fix pull --rev options clashing with --rebase (issue3619)
Rebase also have a plain `--rev` option used to select the rebase set (as
`--base` or `--source` would). But the content of the --rev option was intended
for the remote repo and is irrelevant for the local rebase operation. We expect
`hg pull --rebase` to stick with the default behavior here:

    hg rebase --base . --dest tip(branch(.))

The `rev` option is dropped from the option passed to rebase.
2012-11-29 16:37:15 +01:00
Pierre-Yves David
4dda0af56b mq: drop _cacheabletip usage
Strip have dedicated work around to solve the same problem, strip is even a
fraction faster without that thanks to simpler update process of the branchcache.
2012-12-28 03:42:21 +01:00
Benoit Boissinot
e1a55dc93c zeroconf: use port from server instead of picking port from config (issue3746)
In order to get the port, wrap create server instead of
hgweb_mod/hgwebdir_mod.
2012-12-30 19:19:52 +01:00
Augie Fackler
2316255c71 largefiles: stop using <> operator in favor of !=
<> has been deprecated for a while, and != is futureproof
2013-01-01 13:04:40 -06:00
Pierre-Yves David
febbf1f08f histedit: allow operation from non-head if obsolete is enabled
Obsolescence markers can represent this situation just fine. Rewritten
revisions are marked as precursors of the ones creates by
histedit. Unaffected descendants become "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:46:22 -06:00
Pierre-Yves David
5fe6f9df7f rebase: allow non-head rebase-set when obsolete is enabled
Obsolescence markers can represent this situation just fine. Rebased
revisions are marked as precursors of the ones create by
rebase. Unrebased descendants becomes "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:45:52 -06:00
Mads Kiilerich
9302004c43 largefiles: cleanup of warnings on errors getting largefiles
Especially the "no default or default-push path set in hgrc" was often very
misleading and didn't give any hint where it actually was looking.

A long error messages is better than several multi-line messages.
2012-12-13 19:19:06 +01:00
Mads Kiilerich
f356c36feb largefiles: remove trivial portability wrappers 2012-12-13 19:19:06 +01:00
Mads Kiilerich
8c4d272590 largefiles: remove reporemove portability wrapper 2012-12-13 19:19:06 +01:00
Mads Kiilerich
59edc6b723 largefiles: remove findoutgoing portability wrapper 2012-12-13 19:19:06 +01:00
Mads Kiilerich
b9392de5ec largefiles: use constant for '.hglf/'
Problem: '.hglf' + '/' was computed in some tight loops. There is no need for
that.
2012-12-13 19:19:06 +01:00
Mads Kiilerich
6b50b212dd largefiles: use plain wjoin instead of the complex pathto 2012-12-13 19:19:06 +01:00
Mads Kiilerich
c4f44002f9 largefiles: unindent code 2012-12-28 11:55:57 +01:00
Mads Kiilerich
38f4eda033 largefiles: simplify lfdirstate ignore handling - it is only for tracking .hglf 2012-12-13 19:19:06 +01:00
Mads Kiilerich
ba25df8826 largefiles: rename 'admin' to more descriptive 'lfstoredir' 2012-12-13 19:19:06 +01:00
Mads Kiilerich
8c0ce2a8b9 largefiles: simplify lfutil.getstandinmatcher by inlining getmatcher 2012-12-13 19:19:06 +01:00
Mads Kiilerich
e973341bd0 largefiles: remove overly complex handling of ignored and unknown files 2012-12-13 19:19:06 +01:00
Mads Kiilerich
20020a39e4 largefiles: introduce basic debugstate --large functionality
Very useful for debugging largefiles "performance" issues.

This is used for testing 45d039e26849.
2012-12-28 11:55:57 +01:00
Mads Kiilerich
275333d6c9 util: fold ENOENT check into unlinkpath, controlled by new ignoremissing flag
Refactor a common pattern.
2012-12-28 11:55:57 +01:00
Mads Kiilerich
056fcbf2bc merge with stable 2012-12-28 11:55:45 +01:00
Pierre-Yves David
6f3f4215a3 branchmap: simplify _branchtags using a new _cacheabletip method
The current _branchtags method is a remnant of an older, much larger function.
Its only remaining role is to help MQ to alter the version of branchcache we
store on disk. As MQ mutates the repository it ensures persistent cache does not
contain anything it is likely to alter.

This changeset makes explicit the stable vs volatile part of repository and
reduces the MQ specific code to the computation of this limit. The main
_branchtags code now handles this possible limit in all cases.

This will help to extract the branchmap logic from the repository.

The new code of _branchtags is a bit duplicated, but as I expect major
refactoring of this section I'm not keen to setup factorisation function here.
2012-12-20 11:52:50 +01:00
Bryan O'Sullivan
bac2c7da41 inotify: on Python < 2.6, socket.error lacks errno 2012-12-20 11:40:04 -08:00
Bryan O'Sullivan
783a54d437 inotify: pacify pestiferous pyflakes precipitously 2012-12-19 16:56:26 -08:00
Bryan O'Sullivan
3a10142595 posix: move server side of unix domain sockets out of inotify
We also turn the unix domain socket into a class, so that we have a
sensible place to hang its logically related attributes and behaviour.

We'll shortly want to reuse this in other code.
2012-12-18 17:15:13 -08:00
Bryan O'Sullivan
e063b46f80 inotify: don't fall over just because of a dangling symlink
Previously, the inotify server failed to start if .hg/inotify.sock was
a symlink that pointed to a non-existent path. This behaviour does not
seem to make any sense.

Now, if we encounter a broken symlink, we unlink it and continue.
2012-12-18 17:33:32 -08:00
Siddharth Agarwal
e01899aaca rebase: use lazy ancestor membership testing
For a repository with over 400,000 commits, rebasing one revision near tip,
this avoids one walk up the DAG, speeding the operation up by around 0.8
seconds.
2012-12-17 20:51:21 -08:00
Siddharth Agarwal
7a2f9d28dd transplant: replace incancestors uses with ancestors 2012-12-17 15:08:06 -08:00
Mads Kiilerich
f53a267ea1 mq: don't fail when removing a patch without patch file from series file 2012-12-09 00:25:21 +01:00
Mads Kiilerich
53f5b626ae largefiles: align rm warnings with warnings used in core 2012-12-13 19:19:06 +01:00
Mads Kiilerich
2d06a8beab merge with stable 2012-12-13 21:34:55 +01:00
Mads Kiilerich
ac8e1fc147 check-code: there must also be whitespace between ')' and operator
The check pattern only checked for whitespace between keyword and operator.

Now it also warns:
 >     x = f(),7
 missing whitespace after ,
 >     x = f()+7
 missing whitespace in expression
2012-12-09 23:33:16 +01:00
Pierre-Yves David
5ccc6bfa9a clfilter: rename unfilteredmeth to unfilteredmethod
As originally intended.
2012-11-30 22:34:21 +01:00
FUJIWARA Katsunori
5434449902 i18n: change output of largefiles for summary to distinguish from one for outgoing
Before this patch, largefiles extension uses "largefiles: No remote
repo" message not only for "outgoing" as status report, but also for
"summary" as summarized information.

This sharing prevents message translators from inserting white spaces
between "largefiles:" and "No remote repo" in translated message to
align column position of summarized information.

This patch changes output of largefiles for summary to distinguish
from one for outgoing.

This patch puts "no remote repo" into parentheses, because this is not
summarized information.
2012-10-31 03:59:28 +09:00
FUJIWARA Katsunori
536e35fc32 i18n: make column positioning message of MQ summary output translatable
Before this patch, one of column positioning messages of MQ summary
output is not translatable, and patches are always listed up at fixed
column position like below, when patch queue is not empty:

    mq:     1 applied, 1 unapplied

But column positioning messages for other summarized information are
translatable, so other information may be displayed at different
column position on non-English locale environments.

This patch makes column positioning message of MQ summary output
translatable.
2012-10-31 03:59:28 +09:00
FUJIWARA Katsunori
f05ff4243c i18n: add "i18n" comment to column positioning messages of "hg summary"
This comment makes it easier to distinguish such messages from others
for message translators.
2012-10-31 03:59:28 +09:00
Durham Goode
a2ecd990ef mq: fix qrefresh case sensitivity (issue3271)
When calling qrefresh with filenames, the filenames were being
treated as case-sensistive on case-insensitive file systems.
So 'qrefresh foo' would not match file 'Foo', and it failed silently.
This fix makes it work correctly on case-insensitive file systems.

Previously the matching function was applied directly to the filenames.
Now we apply the matching function through repo.status, which handles
the case logic for us. A side effect of using repo.status is that
if the qrefresh file doesn't exist, there is output stating it
doesn't exist.

Adds a test to an existing mq refresh case test.
2012-10-30 13:19:06 -07:00
Siddharth Agarwal
acc48ffd83 url: use open and not url.open for local files (issue3624) 2012-10-17 21:30:08 -07:00
Julian Cowley
af02d686b4 patchbomb: -c is not an alias for the --confirm option
The help text shows "-c/--confirm", which implies that -c is an alias
for --confirm.  Actually, it is an alias for --cc.  Correct the text
by removing -c.
2012-10-28 05:44:50 -10:00
Matt Harbison
eb56660b19 largefiles: don't copy largefiles from working dir to the store while converting
Previously, if one or more largefiles for a repo being converted were not in the
usercache, the convert would abort with a reference to the largefile being
missing (as opposed to the previous patch, where the standin was referenced as
missing).  This is because commitctx() tries to copy all largefiles to the
local store, first from the user cache, and if the file isn't found there, from
the working directory.  No files will exist in the working directory during a
convert, however.  It is not sufficient to force the source repo to be local
before proceeding, because clone and pull do not download largefiles by default.

This is slightly less than ideal because while the conversion will now complete,
it won't be possible to update to revs with missing largefiles unless the user
intervenes manually, because there is no default path pointing back to the
source repo.  Ideally these files would be cached during the conversion.

This check could have been done in reposetup.commitctx() instead, but this
ensures the local store directory is created, which is necessary to enable the
standin matcher.

The rm -> 'rm -f' change in the test is to temporarily suppress an error
clearing the cache- as noted, the cache is is not repopulated during convert.
When that is fixed, this can be changed back and the verification errors will
disappear too.
2012-10-23 21:32:19 -04:00
Matt Harbison
8973167c73 largefiles: respect the rev when reading standins in copytostore() (issue3630)
When the rev isn't specified, the standin for the working copy gets read.  But
convert doesn't update the working copy for each cset it processes, so there is
no standin and the 'hg convert' would abort complaining about the standin being
missing.

Note that if the largefile is not in the user cache, 'hg convert' complains
about the largefile itself missing from the destination repo.
2012-10-23 21:07:14 -04:00
Pierre-Yves David
afde19de6d largefile: status is buggy on repoproxy, so run unfiltered
For some yet-unkown reason, largefile status does not work on
repoproxy. As status is not affected by filtering, we run it unfiltered.

Na'Tosha Bard's view on this issue:

    "but, well, largefiles status is kind of an unholy piece of code"
2012-10-08 18:11:56 +02:00
Pierre-Yves David
eef465996b clfilter: mq should not warn about filtered mq patches
MQ warns when qstatus contains unknown nodes. With changelog filtering,
a node may be unknown because it is filtered. Thus, an unfiltered repo
is used for this check.
2012-10-08 20:01:40 +02:00
Pierre-Yves David
53c1ae6f54 clfilter: ensure that mq performs commits on unfiltered repos 2012-10-08 18:02:25 +02:00
Augie Fackler
99efe2586b Merge with stable. 2012-11-29 11:44:22 -06:00
Julian Cowley
15e470ce7f convert: add config option to use the local time zone
The default for the time zone offset in a converted changeset has
always been 0 (UTC).  With this patch, the converted changeset is
modified so that the local offset from UTC is specified as the time
zone offset.

The option is specified as the boolean convert.localtimezone (default
False).  Example usage:

    hg convert -s cvs --config convert.localtimezone=True example-cvs example-hg

IMPORTANT: the patch only applies to conversions from cvs or svn.
The documentation for the option only appears in those two sections
in the convert help text.
2012-11-18 12:26:50 -10:00
Siddharth Agarwal
765063c1b4 rebase: use revlog.findmissingrevs to compute detach set 2012-11-27 16:24:21 -08:00
Andrew Shadura
73cc2dd06e hgk: no committer please
Generate committer only if we really have it.
Update test-hgk.t accordingly.
2012-10-16 22:19:08 +02:00
Matt Mackall
fd58e8703f i18n: wrap false positives for translation detection 2012-11-25 13:53:47 -06:00
Bryan O'Sullivan
ffb0e7fc5d eol: don't refer to a random name-captured ui object
Previously, we used a ui object captured at the time of monkeypatching.
2012-11-20 14:21:56 -08:00
Bryan O'Sullivan
469a80b047 mq: don't refer to a random name-captured repo object
Previously, we used a repo object captured at the time of monkeypatching.
2012-11-20 11:52:47 -08:00
Bryan O'Sullivan
8f2116535a convert: fix a too-long line nag 2012-11-13 13:09:42 -08:00
YaNan Xu
69a8b90589 convert: add support for converting git submodule (issue3528)
Previously, convert aborted upon encountering a git submodule. This patch
changes it so that it now succeeds. It modifies convert_git to manually generate
'.hgsub' and '.hgsubstate' files for each git revision, so as to convert git sub
modules to non-mercurial subrepositories.
2012-10-29 17:40:13 -07:00
Augie Fackler
9766845689 bookmarks: introduce a bmstore to manage bookmark persistence
Bookmarks persistence still showed a fair amount of its legacy as a
monkeypatching extension. This encapsulates all bookmarks
serialization and parsing in a single class, and offers a single
location where other bookmarks storage engines can be substituted
in. As a result, many files no longer import the bookmarks module,
which strikes me as an encapsulation win.

This doesn't do anything to the current bookmark state yet, but I'm
hoping put that in the bmstore class as well.
2012-11-07 16:21:39 -06:00
Simon Heimberg
6523213f0e peer: subrepo isolation, pass repo instead of repo.ui to hg.peer
Do not pass ui because it contains the configuration of the repo. It is the
same object as repo.ui.
When a repo is passed to hg.peer, the global configuration is read from
repo.baseui.
2012-07-28 23:28:36 +02:00
Thomas Arendsen Hein
bf24be2a41 patchbomb: respect --in-reply-to for all mails if no intro message is sent
Before this change, the thread hierarchy looked like this:

PARENT
  PATCH1/x
    PATCH2/x
    PATCH3/x
    ...

Now it is:

PARENT
  PATCH1/x
  PATCH2/x
  PATCH3/x
  ...

With an introductory message the behaviour is unchanged:

PARENT
  INTRO
    PATCH1/x
    PATCH2/x
    PATCH3/x
    ...
2012-10-24 09:53:10 +02:00
Matt Harbison
ff98bafc79 largefiles: use 'default' instead of 'default-push' when pulling (issue3584)
This only applies to downloading largefiles, and only when no source for the
pull is explicitly provided.  The repository itself was properly being pulled
via 'default' previously.

Using --all-largefiles is not necessary on a bare pull to test this (this
existing test is merely a convenience), but it is required to test pulling on
the rebase path.

Note that the errors generated in the --rebase case are because the repo
specified doesn't have the largefiles in its cache (though they are in the user
cache), so the errors are misleading.  Specifying --all-largefiles when cloning
to 'b' fixes this, but instead of errors, it reports caching only 5 largefiles
instead of the 9 that come up missing.  Likely this is because the largefile
download procedure tries to download missing files for each rev, and some of the
files have standins in more than one rev that gets pulled.
2012-10-20 21:43:46 -04:00
FUJIWARA Katsunori
d06e5a0fa2 largefiles: distinguish "no remote repo" from "no files to upload" (issue3651)
Before this patch, when no files to upload, "hg outgoing --large" and
"hg summary --large" show "no remote repo", even though valid remote
repository is specified.

It is because that "getoutgoinglfiles()" returns None, not only if no
valid remote repository is specified, but also if no files to upload.

This patch makes "getoutgoinglfiles()" return empty list when no files
to upload, and makes largefiles show "no files to upload" message at
that time.

This patch doesn't test "if toupload is None" route in
"overrideoutgoing()", because this route is not executed unless remote
repository becomes inaccessible just before largefiles specific
processing: successful execution of "orig()" means that at least one
of "default", "default-push" or dest is valid one, and that
"getoutgoinglfiles()" never returns None in such cases.

At "hg summary --large" invocation, this patch shows message below:

    largefiles: (no files to upload)

This follows the message shown by "hg summary" with MQ:

    mq:     (empty queue)
2012-10-08 23:49:36 +09:00
Matt Harbison
7640adfa45 largefiles: always create the cache and standin directories when cloning
The standin matcher only works if the .hglf directory exists (and it won't exist
if 'clone -U' is used, unless --all-largefiles is also specified).  Since not
even 'update -r null' will get rid of the standin directory, this ensures that
the standin directory always exists if the repo has the 'largefiles'
requirement.  This requirement is only set after a largefile is committed, so
these directories will not be created for repos that have the extension enabled
but have not committed a largefile.

With the standin directory in place, 'lfconvert --to-normal' will now be able to
download the required largefiles when converting a repo that was created with
'clone -U', and whose files are not in the usercache.

The downloadlfiles command could probably be put inside the 'largefiles'
requirement conditional too, but given that the user specified --all-largefiles,
there is likely an expectation to print out the number of largefiles downloaded,
even if it is 0.
2012-10-14 15:10:13 -04:00
Matt Harbison
6217120715 largefiles: fix a traceback in lfconvert if a largefile is missing (issue3519)
The largefile may be missing for various reasons, including that a remote
repository was cloned without the --all-largefiles option.  Therefore, it seems
reasonable to attempt to download the missing files and failing that, abort and
indicate the affected file and revision so the user can manually fix the
problem.
2012-10-14 14:44:08 -04:00
Idan Kamara
1d290d6e7b grep: colorize all fields
Colors were picked in accordance to GNU grep.
2012-10-14 20:27:55 +02:00
Pierre-Yves David
dc4260df80 largefile: use self in repo method instead of repo
Most method added (or overwritten) to repo by largefile works on `repo`
instead of `self`. This currently works without trouble because `self` and
`repo` are likely the same. However this is semantically dubious and this may
cause issue for filtering. `self` may be proxy object different from the `repo`
one.

This changeset fix that and use `self` when applicable.
2012-10-08 15:41:58 +02:00
Shun-ichi GOTO
cc7e94372c win32mbcs: add reversing wrapper for some unicode-incompatible functions.
This changeset fix the problem to use win32mbcs with mercurial 2.3 or
later.

The problem is brought by side effect of modification of
encoding.upper() (changeset 17236:8b2442729eb3) because upper() does
not accept unicode string argument. So wrapped util.normcase() which
uses upper() will fail. In other words, upper() and lower() are
unicode incompatible.

To fix this issue, this changeset adds new wrapper for reversed
conversion (unicode to str) for lower() and upper() to use them
safely.
2012-10-17 18:09:00 +09:00
Huayang
2cbf7a996c convert: normalize paths in filemaps (issue3612)
convert doesn't normalise double slashes in paths. Path normalization
is applied when a path is loaded into filemap and when a file lookup
request is issued to filemap.
2012-10-05 16:27:34 -07:00
Christian Ebert
a53e549921 keyword: move commands.inferrepo for code maintenance 2012-10-17 17:32:01 +02:00
Matt Harbison
8c0a3d405b largefiles: update lfutil.findoutgoing() discovery method
It looks like this method missed the updates in 7a899bd0f9c0 (which changed the
preferred discovery method from findcommonincoming() to findcommonoutgoing()),
and 8b2938386599 (which rolls up the outgoing lists into a single object).
2012-10-08 22:43:54 -04:00
Siddharth Agarwal
a5e71891bd commands: don't infer repo for commands like update (issue2748)
Maintain a whitelist of commands to infer the repo for instead. The whitelist
contains those commands that take file(s) in the working dir as arguments.
2012-10-16 11:43:15 -07:00
Pierre-Yves David
4c13968496 histedit: create obsolescence markers in deterministic order
I arbitrary use the revnum of the precursor because it sound a right order.
2012-10-16 16:56:14 +02:00
Thomas Arendsen Hein
4ab7bd04fc histedit: max(x, key=y) and min(x, key=y) are not available in python 2.4
Use sorted(x, key=y)[-1] or sorted(x, key=y)[0] instead.
2012-10-16 16:04:28 +02:00
Pierre-Yves David
e5dbcdf7b1 histedit: do not use "min" on ctx
It does not crash but does not compare revision number at all. We actually
remove any call to min because the list is already topologically sorted.
2012-10-14 23:49:28 +02:00
Pierre-Yves David
29277d440c histedit: clean abort when there is nothing to edit 2012-10-14 23:58:02 +02:00
Pierre-Yves David
c86f3a557a histedit: rename revs in ctxs inside the between function
The variable content is actually contexts, not revision numbers.
2012-10-15 00:05:16 +02:00
Pierre-Yves David
f329dd0261 histedit: refuse to edit public changeset
Public changeset are immutable. This changeset enforce that in histedit.
2012-10-12 21:41:08 +02:00
Pierre-Yves David
2237d9bd3f histedit: ignores hidden revision when checking for orphaned nodes
We do not want hidden revision to block histedit. They are already "dead"
and we do not care about dead orphans. see similar changeset 40db49347807 for
rebase.
2012-09-27 14:00:52 +02:00
Pierre-Yves David
3607c94328 histedit: simplify computation of edited set (issue3620)
This complex code can be replaced by two simple revset calls.
2012-10-10 06:27:06 +02:00
Pierre-Yves David
e4f0351734 histedit: add obsolete support
When the obsolete feature is enabled, histedit creates obsolescence marker
instead of stripping replaced changesets.

For now, we keep stripping temporary nodes created along the way.
2012-09-27 13:59:48 +02:00
Pierre-Yves David
c922450686 histedit: replace various nodes lists with replacement graph (and issue3582)
This changeset rewrites the change tracking logic of histedit to record every
operation it does. Tracked operations record the full list of "old" node that
will eventually be removed to the list of new nodes that replace it. Operations
on temporary nodes are tracked too. Dropped changesets are also recorded as an
"old" node replacement by nothing. This logic is similar to the obsolescence
marker one and will be used for this purpose in later commit.

This new logic implies a big amount of change in the histedit code base.

histedit action functions now always return a tuple of

    (new-ctx, [list of rewriting operations])

The old `created`, `replaced` and `tmpnodes` are no longer returned and stored
during histedit operation. When such information is necessary it is computed
from the replacement graph. This computation is done in the `processreplacement`
function.

The `replacemap` is also dropped. It is computed at the end of the command from the
graph.  The `bootstrapcontinue` methods are altered to compute this different kind of
information.

This new mechanism requires much less information to be written on disk.

Note:

    This changes allows a more accurate bookmark movement. bookmark on dropped
    changeset are now move of their parent (or replacement of their parent)
    instead of their children.

    This fix issue3582
2012-10-11 08:36:50 +02:00
Matt Mackall
5047212c31 merge with durin42 2012-10-12 15:52:59 -05:00
Pierre-Yves David
8b8b1a2322 histedit: update bookmark movement notice
New format is:

    histedit: moving bookmarks <bookmark> from <old> to <new>
2012-10-10 05:54:38 +02:00
Pierre-Yves David
4a01290b0d histedit: simplify computation of newchildren during --continue
We are now checking for any changesets between the previous `parentctx` and the
current working directory parent. If the current working directory parent is
inconsistent, we abort.

This change is useful as it simplifies the --continue process, easing upcoming
changes.

While working on this changeset, I spotted an unhandled corner case. This corner
case is now documented and have an appropriate issue in the tracker (issue3655).
However, the corner case is still unhandled. handling this test case would
required some additional work:

- actually decide what the proper behavior should be:
- change content of "histedit-state" to add missing data necessary to detect
  the situation
- add proper testcase,

But leaving the case unhandled is "okay":

- this is not a regression,
- this is not the purpose of the current series,
- the freeze was near and I had more critical stuff to attend to,
- this is a simple but non trivial, (see above)
2012-10-10 06:20:14 +02:00
David Soria Parra
fb0ed62638 mq: update bookmarks during qrefresh
Bookmarks are updated during qpop and qpush, but they are not updated
during qrefresh. This behaviour makes it hard to work on an evolving
changeset at the head of a branch. qrefresh should update all bookmarks
that point to the refreshed commit with the new nodeid.
2012-10-01 02:44:46 +02:00
Bryan O'Sullivan
52fd9933cb mq: improve qqueue message with patches applied (issue3036) 2012-10-04 17:00:32 -05:00
Bryan O'Sullivan
3048607d30 Merge with crew-stable 2012-10-02 14:31:25 -07:00
Matt Harbison
ca1372542e largefiles: download missing subrepo revs when archiving
This is something plain hgsubrepos already do.  Previously, an abort message
complained about an unknown revision.
2012-09-23 00:08:13 -04:00
Pierre-Yves David
2448b893df histedit: move continue logic into a dedicated function
When histedit "continue", there is several complicated logic to apply in order to
detect intermediate changeset and concluded pending operation.

This changeset extract this logic in a dedicated function to lighten the main
one. No alteration to the logic is done.
2012-09-27 13:54:47 +02:00
Pierre-Yves David
a1ed29a5c8 histedit: rename tip to topmost
I expected `tip` to be repo's tip when it was the rewritten set tip. I rename
the variable to the less ambiguous `topmost`.
2012-09-26 18:13:00 +02:00
Pierre-Yves David
b30bd4fe4d histedit: factorise node stripping logic
Create a function dedicated to stripping a group of node. All existing
duplicated code is replaced by call to this function.

This new function take care of stripping known and relevant node only.
2012-09-26 14:46:08 +02:00
Pierre-Yves David
650044fefe histedit: extract bookmark logic in a dedicated function
This lighten the main function and will help to see future changes to this
bookmark logic.
2012-09-26 14:19:19 +02:00
Pierre-Yves David
9b26a9a8ee histedit: remove all usages of hex[:12]
- `node.hex(n)[:12]` is the same as `node.short(n)`
- `ctx.hex()[:12]` is the same as `str(ctx)`
2012-09-26 12:57:23 +02:00
Matt Mackall
8c86a57e7c merge with stable 2012-09-27 15:51:14 -05:00
Pierre-Yves David
7053ba6e9e histedit: replaces patching logic by merges
The old and fragile patching logic is replaced by smart merges (as rebase and
graft do). This should prevents some conflicts and smoother human resolution.

For this purpose the "foldchanges" function is renamed to "applychanges" and
handle a single revision only.
2012-09-21 19:27:22 +02:00
Pierre-Yves David
f9a739a15f histedit: display action being processed in debug mode
This is very useful when debugging histedit.
2012-09-21 19:25:19 +02:00
Pierre-Yves David
56df9607c6 histedit: fold in memory
Update the folding code to works in memory instead of applying patches on the
working directory. This is cleaner, faster and prepare the removal of the whole
patching logic.

This new collapse function will probably move into core sooner or later. A lot
of other rewriting operation may benefit from it.
2012-09-21 19:24:31 +02:00
Pierre-Yves David
c8363dbc19 histedit: move makedesc function near other rules related function
Having it in the middle of action logic is confusing
2012-09-21 00:33:30 +02:00
Pierre-Yves David
94277b3144 histedit: move between function outside the action logic
Having this function in the middle of action and patching logic did not make
sense
2012-09-21 19:14:04 +02:00
Pierre-Yves David
cb6a116fe7 histedit document the makedest function 2012-09-21 00:30:22 +02:00
Pierre-Yves David
603772df2b histedit: documents the between function 2012-09-21 00:30:07 +02:00
Bryan O'Sullivan
ed33f34e0c Merge with mpm 2012-09-18 16:30:21 -07:00
Pierre-Yves David
7a06ce262e rebase: ensure rebase does not revive extinct revision
Here, we exclude hidden changesets from a rebase operation. If we
don't, a rewritten version of the hidden changesets will be created
by rebase. Those rewritten versions won't be hidden and will likely
conflict with other rewriting or revive pruned changeset. Moreover,
rewriting hidden revisions will surprise the user.

This change would not be necessary if changelog filtering were
already in core. But it's fairly cheap and helps to increase the
test-suite for such filtering.

Once changelog level filtering is added, hidden changes will be
automatically excluded or included according to the global --hidden
flags. Plain ignoring them is good enough for now.
2012-09-18 23:32:42 +02:00
Pierre-Yves David
6fa51bbd6d rebase: remove useless list around repo.revs
As repo.revs already returns a list.
2012-09-18 23:29:05 +02:00
Pierre-Yves David
4e2a2d8f61 rebase: properly handle --collapse when creating obsolescence marker
In collapse mode, that content of state is not suitable to compute obsolescence
markers. We explicitly pass the resulting revision instead and use it as the
successors for all elements of the rebased set.
2012-09-18 23:42:27 +02:00
Matt Mackall
77a75fbd07 merge with stable 2012-09-18 16:19:56 -05:00
Pierre-Yves David
be6378e49d rebase: allow creation obsolescence relation instead of stripping
When obsolescence feature is enabled we now create markers from the rebased
set to the resulting set instead of stripping. The "state" mapping built by
rebase holds all necessary data.

Changesets "deleted" by the rebase are marked "succeeded" by the changeset they
would be rebased one. That the best guess of "successors" we have. Getting a
successors as meaningful as possible is important for automatic resolution of
obsolescence troubles. In other word, emptied changeset will looks collapsed
with their former parents. (see "empty changeset" section of the test if you are
still confused)
2012-09-18 23:13:31 +02:00
Pierre-Yves David
f0bddab386 rebase: extract final changesets cleanup logic in a dedicated function
At the end of the rebase, rebased changesets are currently stripped. This
behavior will be eventually dropped in favor of obsolescence marker creation.

The main rebase function is already big and branchy enough. This changeset move
the clean-up logic in a dedicated function before we make it more complex.
2012-09-18 22:58:12 +02:00
Matt Mackall
b0dd832e65 merge with stable 2012-09-17 15:13:17 -05:00
Nikolaj Sjujskij
88edfbe265 record: fix display of non-ASCII names in chunk selection
46cdcb89086f fixed display of non-ASCII names in file-selecting prompt, but
display in chunk selection remained broken. The reason is that using '%r' in
string formatting results in calling `repr` on file names, thus mangling
non-ASCII ones.
2012-09-15 00:06:08 +04:00
Matt Harbison
fa8ea6e5a3 largefiles: delegate to the wrapped clone command
This allows the wrapped command's validation code to run (which is currently
only to ensure 'noupdate' and 'updaterev' aren't both specified), the
copy/pasted unpacking of hg.clone() args to be removed, and any future changes
to the base command (however unlikely) to be inherited by largefiles.

Unfortunately, the command override can't be swapped entirely for an hg.clone()
override because the extra --all-largefiles arg needs to be injected.  It also
isn't enough to call the wrapped clone command and leave the caching code after
it, because the file caching code needs access to the destination repo, which is
only available from hg.clone().  An alternative would be to use the dest path in
the clone command override to re-obtain a reference to the repo.

A slight deviation from the regular hg.clone() function is that the repo is NOT
deleted if the caching fails, but that was also the previous behavior.  Maybe it
should for consistency?
2012-09-09 12:43:24 -04:00
Matt Harbison
b14b475d95 largefiles: don't convert dest=None to dest=hg.defaultdest() in clone command
A status message is output if hg.clone() determines the default destination
because None was provided.  The previous code never passed None to hg.clone().
2012-09-09 12:09:53 -04:00
Matt Harbison
93f873fbd2 largefiles: restore caching of largefiles with 'clone -U --all-largefiles'
This was broken when restoring normal -u and -U functionality.
2012-09-09 03:37:38 -04:00
Matt Harbison
3eb1617064 largefiles: restore normal 'clone -u' and 'clone -U' functionality
Previously, tip would be checked out regardless of the -u or -U parameter.  I'm
not sure what the 'required for successful walkchangerevs' comment meant, but it
appears to reference code which has since moved to downloadlfiles() in
5c06bddf85b8.  Perhaps it was to force caching when the -U parameter is given?
The price of this change is that -U --all-largefiles won't cache anything.  That
will be fixed next.

Note that X + Y in the 'X largefiles updated, n removed' and 'Y additional
largefiles cached' lines do not add up to the same values in these tests, but
all of the largefiles have been downloaded.  The reason being that several
largefiles have the same content (eb7338044 is pointed to by sub/large2, large3
and sub/large4).  In the 'clone -u 1' operation, this largefile is cached to
populate the working directory, even without --all-largefiles.  That means the
file isn't downloaded again and cached in the rev where large3 and sub/large4
both point to this file.  Downloading that one file in that one rev seems to be
counted twice with 'clone -u 0'.  (Maybe it is also being downloaded twice?)
2012-09-08 13:31:06 -04:00
Matt Harbison
d3a4f5a08b largefiles: preserve the exit status of the forget command
This maintains the exit codes documented in commands.py.
2012-09-05 22:42:23 -04:00
Matt Harbison
0931dc58e6 largefiles: preserve the exit status of the rebase command 2012-09-05 22:31:03 -04:00
Matt Harbison
ac0da61364 largefiles: preserve the exit status of the log command 2012-09-05 22:12:40 -04:00
Matt Harbison
4cda36b611 largefiles: exit from remove with 1 on warnings
This maintains the exit codes documented in commands.py.
2012-09-09 20:18:08 -04:00
Matt Harbison
096f56ab20 largefiles: preserve exit code from outgoing command (issue3611)
This maintains the exit codes documented in commands.py.
2012-09-05 21:26:08 -04:00
Patrick Mezard
e64291c725 convert: use subprocess for all commandline calls
Avoid mixing popen and subprocess calls, it simplifies the command line
generation and quoting issues with redirections.

In practice, it fixes the subversion sink on Windows and probably helps
with monotone and darcs sources.
2012-08-03 21:37:33 +02:00