Commit Graph

20061 Commits

Author SHA1 Message Date
Mads Kiilerich
bcec8229ea largefiles: don't prompt for normal/largefile changes when doing plain updates
We used to get like:

  $ hg up -r 2
  foo has been turned into a normal file
  keep as (l)argefile or use (n)ormal file? l
  getting changed largefiles
  0 largefiles updated, 0 removed
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  $ cat foo
  cat: foo: No such file or directory
  [1]

- which both asked the wrong question and did the wrong thing.

Instead, skip this conflict resolution when the local conflicting file has been
scheduled for removal and there thus is no conflict.
2013-10-25 02:33:59 +08:00
Mads Kiilerich
d2031cc679 largefiles: remove extra check for file to get - it _is_ by definition in p2 2013-10-25 02:25:10 +08:00
Mads Kiilerich
db98125811 largefiles: don't process merge actions at all when overwriting 2013-10-25 01:24:10 +08:00
Mads Kiilerich
eabc047878 spelling: random spell checker fixes 2013-10-24 01:49:56 +08:00
Mads Kiilerich
63e01aeb0a largefiles: hide passwords in URLs in ui messages 2013-10-17 16:13:15 +08:00
Mads Kiilerich
59f7203fee largefiles: don't add extra \n when displaying remote messages in putlfile 2013-10-24 01:49:56 +08:00
Mads Kiilerich
46512da6c4 largefiles: add missing \n in ui.warn messages 2013-10-21 11:22:54 +08:00
Mads Kiilerich
ee0298712d largefiles: fix 'unexpected response' warning newlines
Warnings should always end with \n. The warning message might contain or end
with \n, so better show it with repr encoding.
2013-10-24 01:49:56 +08:00
Pascal Quantin
e36cdfe78f win32: add shelve extension to mercurial.ini 2013-10-21 23:40:56 +02:00
Javi Merino
74347222ce strip: fix spelling: "allows to" -> "allows you to" 2013-10-21 22:23:36 +01:00
Yuya Nishihara
4a2a9b7d3a cmdutil: fix makefileobj not to clobber default modemap dict
Problem occurs if "hg cat -o" is invoked more than once in the same process.
The output of "hg cat" will be appended because of modemap[fn] = 'ab'.
2013-10-22 23:38:58 +09:00
Takumi IINO
c3c2c45028 shelve: make unshelve work even if it don't run in repository root
revertfiles are relative to the repository root. not paths relative to the cwd.
2013-10-22 12:41:05 +09:00
Matt Mackall
b3d6f9b337 tests: move generaldelta test to inline python (issue4064) 2013-10-21 10:50:58 -07:00
Matt Mackall
6ddd78602b help: minor tweak to push help 2013-10-21 10:26:38 -07:00
Johan Bjork
6055bcdec2 patch: ensure valid git diffs if source/destination file is missing (issue4046)
This is arguably a workaround, a better fix may be in the repo to
ensure that it won't list a file 'modified' unless there is a file
context for the previous version.
2013-10-13 08:38:30 -04:00
FUJIWARA Katsunori
6371252cb7 histedit: add description about exit code 2013-10-27 00:24:25 +09:00
FUJIWARA Katsunori
88d39077f8 rebase: add description about exit code when there are unresolved conflicts 2013-10-27 00:24:25 +09:00
FUJIWARA Katsunori
46e5c834e4 shelve: remove unused variable assignment
Fix test-check-pyflakes.t error after 98058c06ff6b.

This patch replaces "readshelvedfiles()" invocation by
"shelvedfile().exists()" check and aborting, because it is required
only to ensure that shelved changes corresponded to specified name
exist after invocation.

This patch also remove definition of "readshelvedfiles()" itself,
because it is invoked only from the line removed by this patch.
2013-11-02 04:49:42 +09:00
Pierre-Yves David
6652b6ffb3 rebase: fix selection of base used when rebasing merge (issue4041)
Prior this changeset, rebasing a merge whose first parent was not in
the rebase lead to wrong and highly conflicting merge. See the in-line
comment for details.

Test have been updated with the data provided by the reported.
2013-10-30 19:45:14 +01:00
Pavlos Touboulidis
7e1d441f10 doc: fix internal date sample (issue4072) 2013-10-29 21:54:49 +02:00
Mads Kiilerich
3c628b9e09 largefiles: use 'remote'/'local' in merge prompts like in other merge prompts
Prompts like
  foo has been turned into a largefile
  use (l)argefile or keep as (n)ormal file?
was not as clear as the usual prompts that use 'remote' or 'local' to explain
what happened on which side ... especially not when used to the normal prompts.

"as" could also indicate that it would be possible to take the content of the
largefile and somehow put it into the normal file. It could make it more clear
that it was a choice between one side or the other.

For consistency we will now phrase it like:
  remote turned local normal file f into a largefile
  use (l)argefile or keep (n)ormal file?
2013-10-28 22:34:07 +01:00
Mads Kiilerich
fa135cf955 largefiles: systematic testing of merges to/from largefiles
bc94b1afd3c9 fixed one problem with update and added a test case for it. The
test coverage was thus insufficient before that.

To make sure we have good test coverage in this area we add systematic testing
of all cases of merges that may or may not change normal files to largefiles or
vice versa.

The tests shows some annoying extra merge prompts in some cases, but these
prompts are hard to avoid and they are now "safe" - they do not leave the
system in a confused inconsistent state.
2013-10-28 22:34:05 +01:00
Mads Kiilerich
a07958f34c check-code: fix no-check-code skip message - obfuscation was too obscure 2013-10-23 23:42:13 +08:00
FUJIWARA Katsunori
fde2c292ff shelve: remove useless and incorrect code paths for file access
This patch removes code paths in "shelvedfile.opener()", because:

    - explicit "vfs.mkdir()" invocation is useless

      "vfs.__call__()" for modes other than "read" creates parent
      directory of target file automatically by "util.ensuredirs()".

    - mode checking in "except IOError" code path is useless

      ENOENT occurs only for "read" mode, because target file is
      created forcibly for other modes.

    - there is no explicit "return" statement in the code path for
      "except IOError" if "mode[0] in 'wa'"

      this is incorrect, because None may be returnd unexpectedly,
      even though it seems the EEXIST case in the directory creation
      race for ".hg/shelved" and is very rare.

      this directory creation race is also treated in
      "util.ensuredirs()".
2013-10-29 01:03:43 +09:00
FUJIWARA Katsunori
98a7c1d4c1 shelve: disallow commit while unshelve is in progress
Before this patch, commit is allowed even while unshelve is in
progress.

In the other hand, "hg unshelve --abort" and "hg unshelve --continue"
check whether parent revisions of the working directory have changed
or not since last "hg unshelve", and abort without clearing state for
unshelve in progress if they have.

This causes that accidental commit makes clearing state for unshelve
difficult in ordinary ways.

This patch disallows commit while unshelve is in progress for
consistency.
2013-10-29 01:03:43 +09:00
Matt Mackall
a40dbdbbc6 bdiff: avoid a memory error on malloc failure 2013-10-30 16:03:42 -05:00
David Soria Parra
d4d544f551 pager: honour internal aliases
If paging is configured for a command all it's internal defined aliases
will be paged as well. This will make attend=log cause 'hg history'
to run the pager. However custom aliases will not be paged by default.
2013-10-12 18:51:34 -07:00
Matt Mackall
1c2609ed8a Added signature for changeset a0d2347ecd75 2013-10-20 16:45:04 -07:00
FUJIWARA Katsunori
9246c0599a discovery: revise hint message introduced by changeset 49ed20ea8da0
This patch revises hint message from "for detail about" introduced by
changeset 49ed20ea8da0 to "for details about", to unify it with the
hint message introduced by proceeding patch.
2013-10-03 23:16:07 +09:00
FUJIWARA Katsunori
ad1b5de6ff push: add more detailed explanation about "--force" to online help document
This patch adds more detailed explanation about "--force" to online
help document of "hg push" to prevent novice users to execute "push
--force" easily without understanding about problems of multiple
branch heads in the repository.
2013-10-03 23:16:06 +09:00
FUJIWARA Katsunori
3198fa3830 push: hide description about "-f" in the hint to prevent from using it easily
"use push -f to force" in the hint at abortion of "hg push" may cause
novice users to execute "push -f" easily without understanding about
problems of multiple branch heads in the repository.

This patch hides description about "-f" in the hint, and leads into
seeing "hg help push" for details about pushing new heads.
2013-10-03 23:16:06 +09:00
FUJIWARA Katsunori
d01f604fec demandimport: allow extensions to import own modules by absolute name
Before this patch, python modules of each extensions can't import
another one in own extension by absolute name, because root modules of
each extensions are loaded with "hgext_" prefix.

For example, "import extroot.bar" in "extroot/foo.py" of "extroot"
extension fails, even though "import bar" in it succeeds.

Installing extensions into site-packages of python library path can
avoid this problem, but this solution is not reasonable in some cases:
using binary package of Mercurial on Windows, for example.

This patch retries to import with "hgext_" prefix after ImportError,
if the module in the extension may try to import another one in own
extension.

This patch doesn't change some "_import()"/"_origimport()" invocations
below, because ordinary extensions shouldn't cause such invocations.

    - invocation of "_import()" when root module imports sub-module by
      absolute path without "fromlist"

      for example, "import a.b" in "a.__init__.py".

      extensions are loaded with "hgext_" prefix, and this causes
      execution of another (= fixed by this patch) code path.

    - invocation of "_origimport()" when "level != -1" with "fromlist"

      for example, importing after "from __future__ import
      absolute_import" (level == 0), or "from . import b" or "from .a
      import b" (0 < level),

      for portability between python versions and environments,
      extensions shouldn't cause "level != -1".
2013-10-05 01:02:22 +09:00
FUJIWARA Katsunori
24ac3edef8 demandimport: support "absolute_import" for external libraries (issue4029)
Before this patch, demandimport of Mercurial may fail to load external
libraries using "from __future__ import absolute_import": for example,
importing "foo" in "bar.baz" module will load "bar.foo" if it exists,
even though "absolute_import" is enabled in "bar.baz" module.

So, extensions for Mercurial can't use such external libraries.

This patch saves "level" of import request for on-demand module
loading in the future: default value of level is -1, and level is 0
when "absolute_import" is enabled.

"level" value is passed to built-in import function in
"_demandmod._load()" and it should load target module correctly.

This patch changes only one "_demandmod" construction case other than
cases below:

    - construction in "_demandmod._load()"

      this code path should be used only in relative sub-module
      loading case

    - constructions other than patched one in"_demandimport()"

      these code paths shouldn't be used in "level != -1" case
2013-10-05 01:02:22 +09:00
FUJIWARA Katsunori
aa64a2119a hghave: add "py3k" feature to check whether test runs with Python 3.x
This patch adds "py3k" feature to check whether test runs with Python
3.x.

This check is needed for portability of test code: for example, in the
default, modules are imported relatively first with python 2.x, but
imported absolutely with Python 3.x.
2013-10-05 01:02:22 +09:00
FUJIWARA Katsunori
c46519c9ab hghave: add "absimport" feature to check "absolute_import" in __future__
This patch adds "absimport" feature to check whether "absolute_import"
exists in __future__, which means supporting module loading by
absolute name.

This check is needed for portability of test code using
"absolute_import", because Python earlier than 2.5 doesn't support it.
2013-10-05 01:02:22 +09:00
Siddharth Agarwal
69eb5c00b0 merge: exit early during a no-op update (BC)
hg update . (or equivalents) are effectively no-ops in just about all
circumstances.  These sorts of updates can be especially common in a
bookmark-oriented workflow. This saves us a status check and a manifest
decompression, which means that on a repo with over 210,000 files, this brings
hg update . down from 2.5 seconds to 0.15.

There is one change in behavior: a file that was added, not committed, and then
deleted but not removed used to be removed from the dirstate. With this patch
it isn't. This is what causes the change in test-mq-qpush-exact.t. This seems
like it's enough of an edge case to not be worth handling.

The output of test-empty.t changes because those files are not yet created.
2013-10-01 17:43:54 -07:00
FUJIWARA Katsunori
fb1d8fd59b localrepo: invoke only feature setup functions for enabled extensions
Before this patch, each feature setup functions for localrepository
class should examine whether corresponding extension is enabled or not
by themselves.

This patch invokes only feature setup functions defined in module of
enabled extensions, and it makes implementation of feature setup
functions easier and simpler.
2013-10-17 21:45:17 +09:00
Yuya Nishihara
a87a5e29b1 lock: handle race in trylock/testlock on Windows
readlock may raise IOError if the system does not support symlink.
2013-10-02 21:16:40 +09:00
Pierre-Yves David
728287dcde rebase: preserve active bookmark when not at head (issue3813)
Now that the working directory parent is preserved, we can preserve the active
bookmark too.
2013-10-14 17:12:59 +02:00
Pierre-Yves David
a9b7960ae6 rebase: preserve working directory parent (BC)
Prior to this changeset, rebase always left the working directory as a parent of
the last rebased changeset. The is dubious when, before the rebase, the working
directory was not a parent of the tip most rebased changeset.

With this changeset, we move the working directory back to its original parent.
If the original parent was rebased, we use it's successors.

This is a step toward solving issue3813 (rebase loses active bookmark if it's
not on a head)
2013-10-14 16:12:29 +02:00
Pierre-Yves David
681ea926e5 tests: prepare rebase test for wc parent preservation
In the way to solving issue3813 we'll preserve the working directory parent
after the rebase. Multiple rebases test expect the working directory parent to
be tip after rebase. We patches them before the actual change to prevent
confusion.
2013-10-14 16:49:54 +02:00
Simon Heimberg
4f0e71ba4d tests: test-gendoc.t checks if anything was translated
This would triggered when the variable would be set wrong again.
2013-10-18 18:56:52 +02:00
Simon Heimberg
93c228cff0 tests: really test translations for rst syntax errors (issue4003)
The variable LC_ALL did not work, use LANGUAGE instead. Before this patch, the
original language C was generated (and tested) in every run.
2013-10-18 18:49:45 +02:00
Simon Heimberg
caa649cd1c i18n: fix wrong rst syntax
Fix syntax errors like wrong indentation and invalid quotation.
All errors preventing to generate valid html documentation (by gendoc.py) are
fixed.
2013-10-18 18:49:32 +02:00
Matt Mackall
bdb0bfd963 i18n-ru: fix the language team field
Having this at the default value caused some versions of msgfmt to
give fatal errors.
2013-10-19 17:26:34 -07:00
Mads Kiilerich
a971393dbd commands: refactor 'serve', extract the http service class 2013-10-10 04:32:36 +02:00
Mads Kiilerich
72342dd16e largefiles: refactor basestore, extract _gethash method 2013-10-10 04:28:44 +02:00
Mads Kiilerich
aff7af83da largefiles: make the protocol hack for replacing heads with lheads more precise
Before the hack would replace 'heads' with 'lheads' no matter where it occured
in a batch command string.

Instead we will use a regexp to more carefully only match the 'heads' commands.
2013-10-10 04:28:39 +02:00
Brodie Rao
c42d4c5508 localrepo: remove unused repo.branchtags()/_branchtip() methods 2013-09-16 01:08:29 -07:00
Brodie Rao
7dec608ff1 hgweb: simplify branches with repo.branchmap().iterbranches() 2013-09-16 01:08:29 -07:00