Commit Graph

20262 Commits

Author SHA1 Message Date
Matt Mackall
35b203d694 merge with stable 2014-02-09 18:36:37 -06:00
Mads Kiilerich
4aef593d5a merge: don't overwrite file untracked after remove, abort with 'untracked files'
Merge could overwrite untracked files and cause data loss.

Instead we now handle the 'local side removed file and has untracked file
instead' case as the 'other side added file that local has untracked' case:

  FILE: untracked file exists
  abort: untracked files in working directory differ from files in requested revision

It could perhaps make sense to create .orig files when overwriting, either
instead of aborting or when overwriting anyway because of force ... but for now
we stay consistent with similar cases.
2014-02-10 00:43:54 +01:00
Mads Kiilerich
673ec76229 convert: secret config option for disabling debugsvnlog
Subversion issues involving svn log such as 1e493b49245f can be tricky to
debug when it is run in an 'hg debugsvnlog' sub process. Debugging is simpler
when convert only uses one process.

With this change convert will invoke the svn log directly when setting
  [convert]
  svn.debugsvnlog = False

This is intentionally not documented.
2014-02-07 17:29:37 +01:00
Mads Kiilerich
17aeb0d9e4 convert: make subversion revsplit more stable when meeting revisions without @
revsplit would crash for instance if given a subversion string without @ ...
and that could somehow happen when playing around with convert.
2014-02-07 17:28:37 +01:00
Lucas Moscovicz
c5d089f8a5 revset: minor changes adding baseset to revsets
Changed bits of code to work with baseset implementations.
2014-02-06 14:57:25 -08:00
Lucas Moscovicz
91dcdf4e40 revset: added __add__ method to baseset class 2014-02-06 11:37:16 -08:00
Lucas Moscovicz
03857b594a revset: added docstring to baseset class 2014-02-06 11:33:36 -08:00
Mads Kiilerich
64b341109f shelve: better (and slightly redundant) test coverage for unshelve conflicts 2014-02-10 00:54:40 +01:00
Mads Kiilerich
2f8ea0775f shelve: status messages from unshelve
It was hard for the user to know what was going on when unshelving - especially
if the user had to resolve conflicts and thus got to see the intermediate
states.

Seeing that pending changes was gone could scare the user, make him panic, and
do stuff that really made him lose data.

Merging (both when rebasing and with pending changes) also requires some
understanding of where in the process you are and what you are merging.

To help the user we now show a couple of status messages (when relevant):
  temporarily committing pending changes (restore with 'hg unshelve --abort')
  rebasing shelved changes
2014-02-10 00:54:27 +01:00
Mads Kiilerich
bdf9713a66 shelve: be quiet when unshelve pulls from the shelve bundle
unshelve was quite verbose and it was hard for a user to follow what really was
going on. It ended up saying 'added 1 changesets' ... but the user just
expected and got pending changes and never saw any changeset.

The use of bundles is an implementation detail that we don't have to leak here.

Pulling is quite verbose, optimized for pulling many changesets from remote
repos - that is not the case here.

Instead, set the quiet flag when pulling the bundle - not only when temporarily
committing pending changes.

The 'finally' restore of ui.quiet is moved to the outer try/finally used for
locking.
2014-02-10 00:54:12 +01:00
Mads Kiilerich
a9a1d1164b shelve: add 'changes to' prefix to default shelve message
The shelved changes _could_ perhaps be amended to the parent changeset but it
_is_ not the parent changeset. Using the description from the parent changeset
is thus wrong and confusing.

Instead, add a 'changes to' prefix.
2014-02-10 00:53:27 +01:00
Mads Kiilerich
413adcdee8 shelve: mention FILE options in help
Shelve do normally take a list of files or patterns to shelve and the command
summary should thus show [FILE]...

Note: --delete is a bit special and interpret the parameters as a list of
shelve names. This change makes that even less obvious from the help. Too bad
- we can't please everyone.
2014-02-10 00:53:27 +01:00
Mads Kiilerich
260919a724 shelve: mention walk options in help 2014-02-10 00:53:25 +01:00
Mads Kiilerich
babd17546d shelve: really pass publicancestors to changegroupsubset - not the parents
publicancestors returned the parents of the public ancestors ... and
changegroupsubset used the parents of these as base for the bundle. That gave
bundles with one layer of changesets more than necessary.
2014-02-10 00:52:56 +01:00
Mads Kiilerich
057621541a shelve: publicancestors do not have to visit nullrev
Not visiting nullrev seems more correct and might be a minor optimization.
2014-02-10 00:52:46 +01:00
Mads Kiilerich
a649a1436b localrepo: make it clear that changegroupsubset doesn't take bases but roots
changegroupsubset will take the parents of the roots to find the bases.

Other parts of Mercurial do not expect that, and a result of that is that some
bundles contain more changesets than necessary.

No real changes here - just renaming a parameter to document what it is.
2014-02-10 00:52:16 +01:00
Matt Mackall
fd6c6f9614 hgweb: hack around mimetypes encoding thinko (issue4160)
A correct patch for this has existed in Python's BTS for 3 years
(http://bugs.python.org/issue9291), so waiting for it to be fixed
upstream is probably not a viable strategy. Instead, we add this
horrible hack to workaround the issue in existing copies of Python
2.4-2.7.
2014-02-05 17:23:35 -06:00
Augie Fackler
859551f9b1 repoview: use repo.revs() instead of a private revset method
Breaks an import cycle.
2014-02-04 17:13:45 -05:00
Augie Fackler
888bc814fa commands: use ctx.getfileset instead of fileset.getfileset 2014-02-04 14:55:04 -05:00
Matt Mackall
5a04f42dce push: backout b359130ef1bc due to test failures 2014-02-09 17:31:26 -06:00
Matt Mackall
a08d7350cb mq: fix qimport url check 2014-02-09 17:30:49 -06:00
Augie Fackler
edc98c0164 match: use ctx.getfileset() instead of fileset.getfileset()
Resolves an import cycle involving match and merge.
2014-02-04 14:54:42 -05:00
Augie Fackler
550a17aab3 context: add a getfileset() method so fewer things need fileset directly
Allows me to break an import cycle in a subsequent change.
2014-02-04 15:27:49 -05:00
Augie Fackler
5de383e853 fix_bytesmod: fix defects in fix_bytesmod so it produces working code
Prior to this change, the fixer did not always add the py3kcompat
import to files, and did not manage to blacklist itself.
2014-02-04 18:09:20 -05:00
Mads Kiilerich
fee088299f discovery: improve "note: unsynced remote changes!" warning
This note (which actually is a warning) frequently caused confusion.
"unsynced" is not a well established user-facing concept in Mercurial and the
message was not very specific or helpful.

Instead, show a messages like:
  remote has heads on branch 'default' that are not known locally: 6c0482d977a3
and show it before aborting on "push creates new remote head". This will also
give more of a hint in the case where the branch has been closed remotely and
'hg heads' thus not would show any new heads after pulling.

A similar (but actually very different) message was addressed in cbd5a12a601a.
2014-02-06 02:19:38 +01:00
Mads Kiilerich
c9112a6b7a convert: drop unused getheads from sinks 2014-02-07 17:26:28 +01:00
Simon Heimberg
2fbc376260 tests: on windows, run command explicitly in sh for working command substitution
On windows, os.system runs the command in cmd.exe, which does not know command
substitution. To let this work, run the command explicitly in sh.

This fixes the failure of this test on windows.
2014-02-08 10:41:17 +01:00
Siddharth Agarwal
228773d706 hg: note that islocal only accepts paths pointing to repos
hg.islocal doesn't work for paths pointing to non-repos, such as patch files.
2014-02-03 14:36:20 -08:00
Siddharth Agarwal
cfe3861321 hg.openpath: use url.islocal to tell if the path is local (issue3624)
Previously we used hg.islocal, which doesn't work for paths pointing to
non-repos, such as patch files.
2014-02-03 14:53:44 -08:00
Siddharth Agarwal
22a22b291a util.url: add an 'islocal' method
This returns True if the URL represents a path that can be opened locally,
without needing to go through the entire URL open mechanism.
2014-02-03 14:47:41 -08:00
Matt Mackall
4a9059c01f Added signature for changeset 235171a1c71c 2014-02-01 15:20:49 -06:00
Matt Mackall
681a024aa8 merge with i18n 2014-02-01 14:53:52 -06:00
Pierre-Yves David
b563457396 rebase: do not crash in panic when cwd disapear in the process (issue4121)
Before this patch rebase crashed badly when it happend. (not abort, crash).

Fix courtesy of Matt Mackall.
2014-01-31 15:13:15 -08:00
Pierre-Yves David
0d013e32a2 record: use absolute path instead of os.chdir
Record was changing the current directory to `repo.root` in order to be able to
feed `command.commit` file name relative to this `repo.root`. This is a bit
overkill and prevent an incoming fix to rebase. This would also break
multi-threaded usage.

Instead we just feed `command.commit` with absolute path name. works as well as
before but without chdir.
2014-01-31 14:52:53 -08:00
Wagner Bruna
7d02010045 i18n-pt_BR: synchronized with 14badd276955 2014-01-31 15:25:31 -02:00
FUJIWARA Katsunori
1faeeaaaaa i18n-ja: change translation to fix test-gendoc.t failure with old docutils
Before this patch, "ja.po" translation causes test-gendoc.t failure
with old docutils: It fails with docutils 0.7, but not with 0.11.
2014-01-31 16:27:26 +09:00
Simon Heimberg
0663ca30c6 i18n-de: update many fuzzy entries and translate some simple ones
I mainly did the simple cases, like removing ".. note::", changing single
quotes to double quotes and adapting underlining.
Unhelpful msgstr in fuzzy entries are removed. (They were suggestions by the
program msgmerge.)
2014-01-30 23:34:18 +01:00
Angel Ezquerra
83f28887f2 help: improve description of phases.checksubrepos setting
The existing description was a bit hard to understand.
2014-01-29 15:16:36 +01:00
Pierre-Yves David
6265090dee clone: do not turn hidden changeset public on publishing clone (issue3935)
Before this changeset local clone of a repo with hidden changeset would include
then in the clone (why not) and turn them public (plain wrong). This happened
because the copy clone publish by dropping the phaseroot file entirely making
everything in the repo public (and therefore immune to obsolescence marker).

This changeset takes the simplest fix, we deny the copy clone in the case of hidden
changeset falling back to pull clone that will exclude them from the clone and
therefore not turning them public.

A smarter version of copy clone could be done, but I prefer to go for the
simplest solution first.
2014-01-30 11:52:38 -08:00
lstewart
7eb5e89201 convert: use branchmap to change default branch in destination (issue3469)
The fix for issue2653 broke the ability to map the default branch of a source
repository to a non-default named branch in the destination repository.  Leave
the default behaviour as is, but allow the branch name "None" to be used to map
to a non-default named branch in the destination repository.
2014-01-28 14:00:23 +11:00
Simon Heimberg
d4711ad797 tests: test-module-imports.t works on windows (with backslash path sep)
Transform the backslashes to slashes on windows, because they are eaten up by
the shell. (Similar as done in test-check-pyflakes.t.)

This test will not produce a traceback on windows anymore. But the test still
fails because the detected mixed imports differ.
2014-01-28 00:33:52 +01:00
Matt Mackall
5f4b3d5487 qimport: allow importing URLs 2014-02-07 17:54:10 -06:00
Lucas Moscovicz
0c945a320b revset: fixed bug where revset returning order was being changed
Some revsets were innecesarily turning the subset into a set before iterating
over it. This led to returning order changing in some cases.
2014-02-07 15:01:33 -08:00
Augie Fackler
8bfe6ea1ed itersubrepos: move to scmutil to break a direct import cycle 2014-02-03 18:36:00 -05:00
Mads Kiilerich
33b57154bd import-checker: handle standard modules with arch in the filename
Installations with module names like
/usr/lib/python2.7/lib-dynload/bz2.x86_64-linux-gnu.so occurs in the wild.

Let's just ignore everything after first '.' when guessing the Python module
name.
2014-02-07 02:59:46 +01:00
Simon Heimberg
5367e8636c tests: use ls instead of find, all files are in the same directory
In this case find has no advantage compared to ls. Descending into directories
is unnecessary, because there are none.
2014-02-03 20:08:58 +01:00
Simon Heimberg
d11bb41a51 commands: hg debuginstall checks missing templates (issue4151)
Missing templates where not reported as a problem, only an empty bracket
were shown as indication of no found template directory:
  $ hg debuginstall
  *...some lines*
  checking templates ()...
  *...some lines*
  no problems detected

Now the problem is reported and extended with some information. The style
of the messages is adapted to the other messages of debuginstall.

When no templates directories exist, it writes:
  $ hg debuginstall
  *...some lines*
  checking templates ()...
   no template directories found
   (templates seem to have been installed incorrectly)
  *...some lines*
  1 problems detected, please check your install!

When the template map is not found, it writes:
  $ hg debuginstall
  *...some lines*
  checking templates (/path/to/mercurial/templates)...
   template 'default' not found
   (templates seem to have been installed incorrectly)
  *...some lines*
  1 problems detected, please check your install!

When the template map is buggy the message is the same as before. The error
message is shown before the line "(templates seem ...)".


No test is added because testing this failure is complicated. It would
require to modify the templates directory of the mercurial installation,
or to monkey patch a function (os.listdir or any from mercurial.templater)
by a test extension.
2014-01-27 11:17:07 +01:00
Julien Cristau
e78105c48a dispatch: take --hidden from individual commands into account
The command server would otherwise ignore that option, since the repo
object is only created once.
2014-01-27 10:57:20 +01:00
FUJIWARA Katsunori
870ab22a06 doc: fix mistake about matching against directories in "pattern.txt"
This fixes mistake of documentation about matching against directories
in "pattern.txt" introduced by b99923dc748f.

".hgignore" treats specified "glob:" pattern as same as one specified
for "-X" option: it can match against directories, too.

For reference, extra regexp string appended to specified pattern for
each types are listed below: see also "match.match()" and
"match._regex()" for detail.

  ============= ========== ===============
  type          cmdline    -I/-X
  ============= ========== ===============
  glob/relglob  '$'        '(?:/|$)'
  path/relpath  '(?:/|$)'  '(?:/|$)'
  re/relre      (none)     (none)
  ============= ========== ===============

Appending '$' means that the specified pattern should match against
only files.
2014-01-30 15:03:36 +09:00
FUJIWARA Katsunori
0b98e91e90 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
Before this patch, shell alias may be executed by abbreviated command
name unexpectedly, even if abbreviated command name matches also
against the command provided by extension.

For example, "rebate" shell alias is executed by "hg reba", even if
rebase extension (= "rebase" command) is enabled. In this case, "hg
reba" should be aborted because of command name ambiguity.

This patch makes "_checkshellalias()" invoke "cmdutil.findcmd()"
always with "strict=True" (default value).

If abbreviated command name matches against only one shell alias even
after loading extensions, such shell alias will be executed via
"_parse()".

This patch doesn't remove "_checkshellalias()" invocation itself,
because it may prevent shell alias from loading extensions uselessly.
2014-01-29 23:47:54 +09:00