Commit Graph

19811 Commits

Author SHA1 Message Date
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
Durham Goode
4791cb4594 shelve: use rebase instead of merge (issue4068)
Previously, shelve used merge to unshelve things. This meant that if you shelved
changes on one branch, then unshelved on another, all the changes from the first
branch would be present in the second branch, and not just the shelved changes.

The fix is to use rebase to pick the shelve commit off the original branch and
place it on top of the new branch. This means only the shelved changes are
brought across.

This has the side effect of fixing several other issues in shelve:

- you can now unshelve into a file that already has pending changes
- unshelve a mv/cp now has the correct dirstate value (A instead of M)
- you can now unshelve to an ancestor of the shelve
- unshelve now no longer deletes untracked .orig files

Updates tests and adds a new one to cover the issue. The test changes fall into
a few categories:

- I removed some excess output
- The --continue/--abort state is a little different, so the parents and
  dirstate needed updating
- Removed some untracked files at certain points that cluttered the output
2013-10-23 13:12:48 -07:00
FUJIWARA Katsunori
2151b431ba doc: put text into header of 1st column in table to generate page correctly
>From the table without header text of 1st column, docutils generates
the table with fully empty header row.
2013-10-25 01:14:18 +09:00
FUJIWARA Katsunori
23f95aaedb doc: use double quotation mark to quote arguments in examples for Windows users
On Windows, only double quotation mark can quote command line
arguments.

So, this patch uses double quotation mark to quote command line
arguments in all examples of online help document.
2013-10-25 01:14:18 +09:00
FUJIWARA Katsunori
19e586921c doc: end line preceding command line example with double colon 2013-10-25 01:14:18 +09:00
Takumi IINO
56ac953b3c hgweb: add missing semicolon 2013-10-24 21:37:13 +09:00
Mads Kiilerich
0f5241006f rebase: improve error message for more than one external parent 2013-10-23 23:42:13 +08:00
Mads Kiilerich
bb06a4346f rebase: refactor and rename checkexternal - it is a getter more than a setter 2013-10-24 12:05:22 +08:00
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
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
e5bfb7187d mq: refactor usage of repo.branchmap().iteritems() with itervalues() 2013-04-01 20:01:16 -07:00
Matt Mackall
f88eee9dfe merge with stable 2013-10-19 14:21:05 -07:00
Matt Mackall
c8cce47720 merge with i18n 2013-10-19 14:20:31 -07:00
Augie Fackler
7c6d10ed49 shelve: some docstring cleanups 2013-10-16 10:36:58 -04:00
Siddharth Agarwal
7decbaaad4 dirstate.status: return explicit unknown files even when not asked
dirstate.walk will return unknown files that were explicitly requested, even
if listunknown is false. There's no point in dropping these files on the
floor in dirstate.status.

This has no effect on any current callers, because all of them assume the
unknown list is empty and ignore it. Future callers may find it useful,
though.
2013-10-14 00:25:29 -04:00