Commit Graph

11501 Commits

Author SHA1 Message Date
Brodie Rao
11c127f205 alias: ensure checksignature() is applied directly to the command (issue2286)
Aliased commands that received bad arguments would raise TypeError instead of
SignatureError. This only affected commands that weren't wrapped by extensions.
Using util.checksignature() in cmdalias.__call__() ensures SignatureError is
raised correctly.
2010-07-22 15:26:26 -04:00
Mads Kiilerich
cd85e285e0 dispatch: give better error message when cwd doesn't exist (issue2293)
Previous behavior wasn't very helpful:
$ hg st foo
abort: No such file or directory

Now we tell more about what failed:
abort: error getting current working directory: No such file or directory
2010-07-24 00:38:08 +02:00
FUJIWARA Katsunori
567f3e49f2 i18n: safety writing into non-ASCII named files on any shell implementation
some shell implementation (e.g.: dash) can not handle redirection into
non-ASCII UTF-8 named file correctly.
2010-07-22 23:18:38 +09:00
Martin Geisler
4e818c92d7 help: make helptable a list instead of a tuple
The table should always have been a list so that extensions can append
their own help topics -- hgsubversion would like to do this now.
2010-07-22 21:43:45 +02:00
Matt Mackall
4e44d8a129 revset: fix ancestor subset handling (issue2298) 2010-07-22 08:17:38 -05:00
Christian Fischer
1863a66dc9 hgwebdir: use template paths configured in the hgrc (issue2281) 2010-07-12 16:07:58 +02:00
Brodie Rao
bfa13e8d9a bash/zsh completion: use HGPLAIN when invoking hg (issue2297) 2010-07-21 17:06:00 -04:00
Dan Drake
32aaa61ef2 patch: fix extract() docstring, it returns branch as well 2010-07-22 14:30:27 +09:00
Nicolas Dumazet
4a63431eda doc: remove has_key usage in hgmanpage 2010-07-22 14:33:50 +09:00
Nicolas Dumazet
0616cfa31f gendoc: remove callable usage (check-code) 2010-07-22 14:30:29 +09:00
Nicolas Dumazet
cea01fc92a bookmarks: rewrite _bookmarks method documentation 2010-07-21 12:41:18 +09:00
Mads Kiilerich
f9b5838b6f init: create target directory recursively
Subrepos with relative paths must often be cloned to locations deep in the
directory structure. This allows clone over ssh (init+push) work.
2010-07-21 19:29:57 +02:00
Mads Kiilerich
8a38c3ba07 doc: make sure we use our own code for generating man pages
docutils would in some situations pick up its own manpage.py instead of
doc/manpage.py. Renaming to hgmanpage.py makes it less ambiguous.
2010-07-21 17:51:37 +02:00
Greg Ward
692cfc05a8 transplant: crash if repo.commit() finds nothing to commit
(makes issue2135, issue2264 more obvious, but does nothing to fix
either one)

This seems to happen in two distinct cases:
  * patch.patch() claims success but changes nothing (e.g.
    the transplanted changeset adds an empty file that already
    exists)
  * patch.patch() makes changes, but repo.status() fails to report them

Both of these seem like bugs in other parts of Mercurial, so arguably
it's not transplant's job to detect the failure to commit.  However:
  * detecting the problem as soon as possible is desirable
  * it prevents a more obscure crash later, in transplants.write()
  * there might be other lurking (or future) bugs that cause
    repo.commit() to do nothing

Also, in the case of issue2264 (source changesets silently dropped by
transplant), the only way to spot the problem currently is the crash
in transplants.write().  Failure to transplant a patch should abort
immediately, whether it's user error (patch does not apply) or a
Mercurial bug (e.g. repo.status() failing to report changes).
2010-07-18 21:29:29 -04:00
Vishakh H
fb390f5f84 mq: cleanup status if applied mq is stripped (issue1881)
stripping of applied mq patches leads to wrong state recorded in status
file. find all mq patches that will be affected and clean up status file
before strip.
2010-07-20 20:37:29 +05:30
Nicolas Dumazet
7a95a27065 bundle: lookup revisions after addbranchrevs
When addbranchrevs extends revs, it adds changeset hashes, and not node ids.
Which means that we have to lookup for revisions _after_ the addbranchrevs
call, instead of before.
2010-07-20 18:29:00 +09:00
Mads Kiilerich
b098dc8c48 revert: rename original to .orig instead of copying (issue2282)
By renaming before reverting the content of the file we ensure that we handle
and break hardlinks properly.

Handling of other hardlinks to .orig is somebody elses problem.
2010-07-13 03:04:14 +02:00
Greg Ward
08b5f707c3 inotify: make inotifydirstate.status() returns a tuple of lists.
This makes it consistent with dirstate.status(), which is important if
there are other extensions messing with the output of status().  Those
extensions can safely assume that dirstate.status() returns a tuple of
lists, because its docstring says it does.  But
inotifystatus.dirstate() returns a list of lists, which can break
those other extensions.
2010-07-20 14:00:47 -04:00
Steve Losh
aaac1bb52d commands: fix update's help to be more accurate
Branches can have multiple heads, so it doesn't make sense to speak of "the
head of the current branch". What update really does is try to update to the
*tip* of the current branch.
2010-07-14 18:28:12 -04:00
FUJIWARA Katsunori
2f9dbb12f7 i18n: use encoding.colwidth() for correct column width
Some encoding and language combinations (e.g.: UTF-8 and Japanese)
cause encoding characters into sequence of bytes more than column
width of them.

So, encoding.colwidth() should be applied instread of len() on i18n
strings.

In addition to it, formatting by '%*s'/'%-*s' also uses "number of
bytes" to calculate space padding size, and should be fixed, too.
2010-07-18 01:06:50 +09:00
Nicolas Dumazet
631c3ba3c4 context: use os.lstat instead of os.stat to fetch file size
When file is a link, we want the size of the link itself, not the size
of the file it points to.
2010-07-16 16:33:55 +09:00
Martin Geisler
8f362a460f mark ui.warn strings for translation 2010-07-16 14:44:30 +02:00
Martin Geisler
71971a8928 check-code: warn about untranslated ui.warn calls 2010-07-16 14:40:57 +02:00
Mads Kiilerich
b68a37ac34 subrepo: docstrings 2010-07-15 13:24:02 +02:00
Joel Rosdahl
1e185fd1b2 test-log: Add test for "hg log -pf" (issue647)
To test f02da4369319 we analyze this repo:

0 | 1 |   2    | 3  |   4
a  ------------> b
 \
    b -> dir/b -------> e

                 d

We follow dir/b and expects rev 0, 1 and 2.

A log following b will surprisingly report rev 0 and 1. That's because the
content and the parents are the same in rev 1 and rev 3, and the revlog entry
from rev 1 is thus reused in rev 3 even though the revlink is incorrect.

Note that if we follow e then we will get all revs, including rev 3, because b
gets added to the set of interesting filenames we are following through all
revisions. That might be surprising, but that's (currently) how it is.

Original test case by Joel Rosdahl <joel@rosdahl.net>
Original test reviewed by Nicolas Dumazet <nicdumz@gmail.com>
2010-07-08 22:44:15 +02:00
Brodie Rao
e68a4f5865 bookmarks: ensure current bookmark is updated when specified with -r .
"hg bookmark -r . foo" should be equivalent to "hg bookmark foo".
2010-07-14 11:02:20 -04:00
Brodie Rao
6f58bfc15e color/progress: subclass ui instead of using wrapfunction (issue2096)
This resolves the issue of hg cmd --mq not being colorized. This was due
to color wrapping only the instance of ui passed to dispatch._runcommand(),
which isn't the same ui object that mq.mqcommand() receives. After dispatch
calls extensions.loadall(), it makes sure any changes to ui.__class__ in
uisetup are propagated.

progress is updated to wrap ui in the same manner because wrapfunction
doesn't play well when ui.__class__ has been replaced by another extension
(orig will point to the old class method instead of color's).
2010-07-01 19:23:26 -05:00
Henrik Stuart
c5ab8c0508 merge crew and main 2010-07-14 19:43:31 +02:00
Nicolas Dumazet
9085ce94e6 mq: qrepo.add(mq.added) inside save_dirty inside of doing it manually
This should make the MQ API more transparent: callers only have to
call save_dirty, and no mq.added magic or knowledge is required.
2010-07-13 22:30:01 +09:00
Wagner Bruna
521a29b52f i18n-pt_BR: synchronized with 502447ad76b9 2010-07-10 14:28:38 -03:00
Wagner Bruna
db001795e5 merge with stable 2010-07-10 14:01:10 -03:00
Wagner Bruna
befc788225 i18n-pt_BR: synchronized with 3a0ec8607bbc 2010-07-08 15:36:14 -03:00
Mads Kiilerich
337e489bbe convert: cleanup of filemap help text
Clarify that:
- Specified paths are matched by comparing name of file or directory.
- Line order (thus) doesn't matter.
- Rename doesn't imply include.
2010-07-08 15:44:14 +02:00
Martin Geisler
59385f10e8 check-code: add test for callable 2010-07-09 14:01:55 +02:00
Dan Villiom Podlaski Christiansen
11602a3741 extensions: add a few assertions to wrapfunction() and wrapcommand().
Specifically, assert that the given wrapper is callable in both
functions, and assert that the original was also callable in
wrapfunction().
2010-07-09 11:04:00 +02:00
Dan Villiom Podlaski Christiansen
50d47676be extensions: improve language for wrapfunction() docstring. 2010-07-09 11:13:45 +02:00
Dan Villiom Podlaski Christiansen
5987e4e005 extensions: add docstring for wrapcommand(). 2010-07-09 10:57:57 +02:00
Arnab Bose
a9ac0e99d7 commands: mention "hg status -C" in addremove help 2010-07-09 13:31:37 +02:00
Martin Geisler
9d15ddb59c test-merge-closedheads: test 8579fd645006 2010-07-07 14:13:23 +02:00
Robert Bauck Hamar
d6a84c6ef2 commands: only warn when reopening the workdir's branch
When commiting, a check is made to see if one of the parents is a
closed head. However this did not check that the branch of the commit
is the same as the closed head, so one could get a warning message on
the sequence

  hg commit --close-branch
  hg branch new-branch
  hg commit

or when merging in a closed head.
2010-07-07 14:11:59 +02:00
Renato Cunha
6de8a70a9d inotify: check all components of filenames against hgignore (issue884)
With inotify enabled, files that should be ignored could be detected as
untracked by mercurial. This behavior was wrong because inotify's filestatus
implementation only matched filenames against ignore patterns, instead of
checking if other elements of their paths matched them. This patch fixes the
behavior by checking the file paths against the ignore patterns.

A new test has also been added to the main inotify test to prevent any
regressions.
2010-07-06 22:22:18 -03:00
Nicolas Dumazet
cd488569d7 hg.clone: fix branch value when passing a repo object (issue2267)
Since d6ca622d1122 the branch argument for addbranchrevs should be a tuple:
  (hashbranch, branches)
The right empty value therefore is (None, []) instead of None.
2010-07-02 15:05:21 +09:00
Nicolas Dumazet
3005d15f5c test-bheads: use a case-insensitive set of filenames (issue2274)
This prevents false negatives on case-insensitive systems.
2010-07-06 15:05:03 +09:00
Nicolas Dumazet
6b2a6dc615 mail: ensure that Python2.4 to 2.7 use the same header format
Wrapping format for long headers changed in Python2.7 (see Python issue1974).
Adopt the Python2.7 behaviour and backport it for 2.4-2.6
2010-07-06 18:24:04 +09:00
Nicolas Dumazet
70fb2c5315 filelog: cmp: don't read data if hashes are identical (issue2273)
filelog.renamed() is an expensive call as it reads the filelog if p1 == nullid.
It's more efficient to first compute the hash, and to bail early if
the computed hash is the same as the stored nodeid.

'samehashes' variable is not strictly necessary, but helps for comprehension.
2010-07-05 19:49:54 +09:00
Nicolas Dumazet
e3057a06d5 filelog: test behaviour for data starting with "\1\n"
Because "\1\n" is a separator for metadata, data starting with "\1\n" is
handled specifically. It was not tested.

size() call return incorrect data if original data had been "\1\n-escaped".
There's no obvious way to fix it for now, just flag the error in the code
and add an "expected failure" kind of test.
2010-07-05 18:43:46 +09:00
Nicolas Dumazet
6e75efdbcb cmp: document the fact that we return True if content is different
This is similar to the __builtin__.cmp behaviour, but still not
straightforward, as the dailylife meaning of a comparison usually is
"find out if they are different".
2010-07-09 11:02:39 +09:00
Nicolas Dumazet
d78df2ed54 workingfilectx.cmp: invert boolean return value
Apparently we mostly used filectx.cmp(workingfilectx.read()), so no error
was ever triggered, but since all cmp() methods return True when content
are different, that == should in fact be !=
2010-07-09 11:59:48 +09:00
Nicolas Dumazet
2d7fd252ec rebase: small cosmetic cleanups 2010-07-12 19:04:07 +09:00
Giorgos Keramidas
0e555f2d40 rebase: add a test for committed MQ patches (9738fa24c874) 2010-07-12 09:19:28 +03:00