Commit Graph

16456 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
42810f1311 doc: add description about re-opening closed heads to 'Head, closed branch' in glossary 2012-04-23 00:33:09 +09:00
FUJIWARA Katsunori
6ad78ff727 doc: fix careless document miss for term 'Close changeset' in glossary
there is no term 'Changeset, close' in glossary.

'Close changeset' seems to have to be linked not to 'Branch, closed',
but to 'Head, closed branch', because only the latter explains about
"the changeset that marks a head as no longer interesting".
2012-04-23 00:33:09 +09:00
FUJIWARA Katsunori
116491f524 doc: fix careless document miss in help of hgext/notify
according to configuration example below, and direction of changeset
transference, this paragraph should describe about "changegroup" hook.

  [hooks]
  # one email for each incoming changeset
  incoming.notify = python:hgext.notify.hook
  # one email for all incoming changesets
  changegroup.notify = python:hgext.notify.hook

  # one email for all outgoing changesets
  outgoing.notify = python:hgext.notify.hook
2012-04-23 00:30:45 +09:00
FUJIWARA Katsunori
7f1ccfb7bd doc: fix explanation comment in acl extension
according to configuration in "acl.deny" below, group "@hg-denied"
also be denied for all files, so add such description to comment for
configuration.

  [acl.deny]
  # user6 will not have write access to any file:
  ** = user6
  # Group "hg-denied" will not have write access to any file:
  ** = @hg-denied
2012-04-23 00:29:04 +09:00
Mads Kiilerich
a01cdd42fb tests: test test-filelog is python - rename to test-filelog.py 2012-04-23 01:57:17 +02:00
Mads Kiilerich
b7e85cefa1 tests: avoid tab indent on all kinds of lines of sh commands 2012-04-23 01:56:48 +02:00
Mads Kiilerich
f64bae7ea3 tests: use 'do sleep 0' instead of 'do true', also on first line of command
2cd44a791e66 established that '... do true ...' shouldn't be used, but that was
only enforced on continued lines.
2012-04-23 01:56:48 +02:00
Mads Kiilerich
ca99a3d167 check-code: put grouping around regexps generated from testpats
This removes the pitfall that would make the testpath r'a|b' match 'b' on all
lines in .t tests.
2012-04-23 01:56:48 +02:00
Mads Kiilerich
b1160b7ec5 tests: don't use /dev/urandom for largefiles testing
There is no need to use entropy here just to create some content that only will
be used for hashing and ignored.

This avoids a problem where dd from /dev/urandom on solaris generates too short
output.
2012-04-23 01:56:48 +02:00
Cesar Mena
5d1ea9328c encoding: protect against non-ascii default encoding
If the default python encoding was changed from ascii, the attempt to
encode as ascii before lower() could throw a UnicodeEncodeError.
Catch UnicodeError instead to prevent an unhandled exception.
2012-04-22 21:27:52 -04:00
Patrick Mezard
d7a11b26ae update: fix case-collision with a clean wd and no --clean
a317664437ee introduced some logic to avoid case-collision detection between
source and destination revisions when it does not make sense: clean or to be
cleaned working directories. Unfortunately, part of it was flawed and the
related test was broken by another bug.

This patch disables cross revision case collision detection for updates without
option or with --check, if the working directory is clean.
2012-04-23 14:32:59 +02:00
Patrick Mezard
036643538d update: make --check abort with dirty subrepos
Aka "we could use dirty() but... yeah let's use it"
2012-04-23 12:12:04 +02:00
Patrick Mezard
fe825199c5 update: fix "not rev" vs "rev is None" 2012-04-23 12:09:54 +02:00
Matt Harbison
677d4b2efc largefiles: fix status -S reporting of subrepos (issue3231)
Wrapping the status command will only invoke overridestatus() and set
the lfstatus field for the top level repository.  Wrapping the status
function is required to set the field on child repositories.

Previously, status -S would report large files in a subrepo as '?'
regardless of their actual states, and was inconsistent with what
status would report from within that subrepo.
2012-04-22 03:47:34 -04:00
FUJIWARA Katsunori
91701b5919 i18n: use locale insensitive format for datetimes as intermediate representation (issue3398)
on some non "en" locale environments, "hg convert" is aborted, because
"util.parsedate()" fails.

it fails in "memctx.__init__()" called by "putcommit()" of "convert".

in "hg convert", datetimes gotten from source repository
are usually formatted by "util.datestr()" with default format "%a %b
%d %H:%M:%S %Y %1%2".

but on some environments, "%a" and "%b" may cause locale sensitive
string, and such string may cause parse error in "util.parsedate()".

this path uses "%Y-%m-%d %H:%M:%S %1%2" as intermediate representation
format for datetimes, because it consists only of locale insensitive
elements.

datetimes in above format are only used for passing them from
conversion logic to memctx object, so it doesn't have to be formatted
by locale sensitive one.

this patch just avoids locale sensitivity problem of "datestr()" and
"parsedate()" combintion.
2012-04-26 02:41:20 +09:00
Patrick Mezard
36d25dc267 alias: fix shell alias documentation (issue3374)
Described behaviour was the one before shell alias argument handling was
reworked by 20aa889a898f mid-2010.
2012-04-24 14:34:54 +02:00
Patrick Mezard
643070e071 test-convert-svn-sink: add helper to smooth svn xml output
svnxml.py parses "svn log --xml" output and prints the attributes shared among
all tested svn versions. This fixes the test with svn 1.7.

Tested with svn 1.6.12 and 1.7.4.
2012-04-24 13:05:38 +02:00
Patrick Mezard
3a4d3628f4 convert/svn: make svn sink work with svn 1.7
"svn add file" now fails if "file" is already tracked. To filter them we have
to mirror the svn manifest in the sink.

Tested with svn 1.6.12 and 1.7.4.
2012-04-24 12:50:41 +02:00
Mads Kiilerich
c5b35bb774 docs: don't use :hg: at the beginning of lines in notes (issue3397)
It seem like docutils 0.8 interpret ':hg:`command`' roles at the beginning of
indented lines in '.. note::' directives as a field that is an invalid argument
to the directive. It fails with 'Error in "note" directive: invalid option
block.' Docutils 0.7 accepted this arguably incorrect markup.

Reflowing the text makes the problem go away. A leading '\ ' could perhaps also
be used to mask the problem.
2012-04-25 23:28:54 +02:00
Patrick Mezard
3c6f7e9f84 rebase: skip resolved but emptied revisions
When rebasing, if a conflict occurs and is resolved in a way the rebased
revision becomes empty, it is not skipped, unlike revisions being emptied
without conflicts.

The reason is:
- File 'x' is merged and resolved, merge.update() marks it as 'm' in the
  dirstate.
- rebase.concludenode() calls localrepo.commit(), which calls
  localrepo.status() which calls dirstate.status(). 'x' shows up as 'm' and is
  unconditionnally added to the modified files list, instead of being checked
  again.
- localrepo.commit() detects 'x' as changed an create a new revision where only
  the manifest parents and linkrev differ.

Marking 'x' as modified without checking it makes sense for regular merges. But
in rebase case, the merge looks normal but the second parent is usually
discarded. When this happens, 'm' files in dirstate are a bit irrelevant and
should be considered 'n' possibly dirty instead. That is what the current patch
does.

Another approach, maybe more efficient, would be to pass another flag to
merge.update() saying the 'branchmerge' is a bit of a lie and recordupdate()
should call dirstate.normallookup() instead of merge().

It is also tempting to add this logic to dirstate.setparents(), moving from two
to one parent is what invalidates the 'm' markers. But this is a far bigger
change to make.

v2: succumb to the temptation and move the logic in dirstate.setparents(). mpm
suggested trying _filecommit() first but it is called by commitctx() which
knows nothing about the dirstate and comes too late into the game. A second
approach was to rewrite the 'm' state into 'n' on the fly in dirstate.status()
which failed for graft in the following case:

  $ hg init repo
  $ cd repo
  $ echo a > a
  $ hg ci -qAm0
  $ echo a >> a
  $ hg ci -m1
  $ hg up 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg mv a b
  $ echo c > b
  $ hg ci -m2
  created new head
  $ hg graft 1 --tool internal:local
  grafting revision 1
  $ hg --config extensions.graphlog= glog --template '{rev} {desc|firstline}\n'
  @  3 1
  |
  o  2 2
  |
  | o  1 1
  |/
  o  0 0

  $ hg log -r 3 --debug --patch --git --copies
  changeset:   3:19cd7d1417952af13161b94c32e901769104560c
  tag:         tip
  phase:       draft
  parent:      2:b5c505595c9e9a12d5dd457919c143e05fc16fb8
  parent:      -1:0000000000000000000000000000000000000000
  manifest:    3:3d27ce8d02241aa59b60804805edf103c5c0cda4
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  extra:       branch=default
  extra:       source=a03df74c41413a75c0a42997fc36c2de97b26658
  description:
  1

Here, revision 3 is created because there is a copy record for 'b' in the
dirstate and thus 'b' is considered modified. But this information is discarded
at commit time since 'b' content is unchanged. I do not know if discarding this
information is correct or not, but at this time we cannot represent it anyway.

This patch therefore implements the last solution of moving the logic into
dirstate.setparents(). It does not sound crazy as 'm' files makes no sense with
only one parent. It also makes dirstate.merge() calls .lookupnormal() if there
is one parent, to preserve the invariant.

I am a bit concerned about introducing this kind of stateful behaviour to
existing code which historically treated setparents() as a basic setter without
side-effects. And doing that during the code freeze.
2012-04-22 20:06:36 +02:00
Patrick Mezard
9906519ee5 test-rebase: exhibit revisions which should have been skipped
This will be fixed in the next commit.

v2:
- Display emptied grafted revisions
- Use --git flag
2012-04-22 18:27:50 +02:00
Patrick Mezard
7ca23e70fa transplant: do not rollback on patching error (issue3379)
Otherwise, all transplanted revisions are gone and the failing one cannot be
fixed (unless it is the first one).

I do not know what is the expected behaviour with rollback, probably something
pull-like. Non-conflicting cases should work as previously. But something like:

  $ hg transplant r1 r2
  commiting r1 as c1
  failing r2
  $ hg transplant --continue
  committing r2 as c2
  $ hg rollback

would reset the repository to its state before the "transplant --continue"
instead of the whole transplant session. To fix this we might need a way to
open an existing journal file, not sure this is worth the pain.
2012-04-22 16:40:38 +02:00
Patrick Mezard
b5270209ca patch: fix patch hunk/metdata synchronization (issue3384)
Git patches are parsed in two phases: 1) extract metadata, 2) parse actual
deltas and merge them with the previous metadata. We do this to avoid
dependency issues like "modify a; copy a to b", where "b" must be copied from
the unmodified "a".

Issue3384 is caused by flaky code I wrote to synchronize the patch metadata
with the emitted hunk:

 if (gitpatches and
     (gitpatches[-1][0] == afile or gitpatches[-1][1] == bfile)):
     gp = gitpatches.pop()[2]

With a patch like:

 diff --git a/a b/c
 copy from a
 copy to c
 --- a/a
 +++ b/c
 @@ -1,1 +1,2 @@
  a
 +a
 @@ -2,1 +2,2 @@
  a
 +a
 diff --git a/a b/a
 --- a/a
 +++ b/a
 @@ -1,1 +1,2 @@
  a
 +b

the first hunk of the first block is matched with the metadata for the block
"diff --git a/a b/c", then the second hunk of the first block is matched with
the metadata of the second block "diff --git a/a b/a", because of the "or" in
the code paste above. Turning the "or" into an "and" is not enough as we have
to deal with /dev/null cases for each file.

We I remove this broken piece of code:

 # copy/rename + modify should modify target, not source
 if gp.op in ('COPY', 'DELETE', 'RENAME', 'ADD') or gp.mode:
     afile = bfile

because "afile = bfile" set "afile" to stuff like "b/file" instead of "a/file",
and because this only happens for git patches, which afile/bfile are ignored
anyway by applydiff().

v2:
- Avoid a traceback on git metadata desynchronization
2012-04-21 21:40:25 +02:00
Patrick Mezard
4076709ad5 patch: display a nice error for invalid base85 data
Before, import was terminating with a traceback. Now it says:

 $ hg import --no-commit ../bad.patch
 applying ../bad.patch
 abort: could not decode binary patch: bad base85 character at position 66
2012-04-21 19:58:18 +02:00
Patrick Mezard
bed77ab945 revset: fix adds/modifies/removes and patterns (issue3403)
The fast path was triggered if the argument was not like "type:value", with
type a known pattern type. This is wrong for several reasons:
- path:value is valid for the fast path
- '*' is interpreted as a glob by default and is not valid for fast path

Fast path detection is now done after the pattern is parsed, and the normalized
path is extracted for direct comparison. All this seems a bit complicated, it
is tempting to drop the fast path completely. Also, the hasfile() revset does
something similar (only check .files()), without a fast path. If the fast path
is really that efficient maybe it should be used there too.

Note that:

  $ log 'modifies("set:modified()")'

is different from:

  $ log 'modifies("*")'

because of the usual merge ctx.files()/status(ctx.p1(), ctx) differences.

Reported by Steffen Eichenberg <steffen.eichenberg@msg-gillardon.de>
2012-04-26 14:24:46 +02:00
Steven Stallion
1a611af55b plan9: add missing source entries to proto 2012-04-21 08:24:10 -07:00
Brendan Cully
b2a00aaf7c Merge stable 2012-04-22 20:30:36 -07:00
Mads Kiilerich
4c1897dde5 tests: fix incorrect markup of continued lines of sh commands 2012-04-23 01:39:26 +02:00
Mads Kiilerich
9f4ca6b4df check-code: 'printf \0' is apparently fine - accept it in check-code
Nobody complained over '\0' in test-eol.t.

The too strict check becomes a problem when this check is applied to more
lines.
2012-04-23 01:39:26 +02:00
Mads Kiilerich
e5bed4bfb4 tests: solaris sh can not negate exit status with '!' 2012-04-23 01:39:26 +02:00
Mads Kiilerich
8a7b2bbc7f tests: hide diff -u saying 'No differences encountered' on solaris 2012-04-23 01:39:26 +02:00
Mads Kiilerich
d63ff4f9a5 tests: ^ must be quoted when used on solaris sh
The check was broken when it was introduced in 8924361c0202.
2012-04-23 01:39:26 +02:00
Mads Kiilerich
eb3bbec4c3 tests: remove test-pull-pull-corruption2.t
This test gave random failures on slow machines (solaris).

The test was added in 0e28b2998bcf as a test case from issue148. It did however
require manual setup:
  The attached script creates such a corruption (you have to add a "import time;
  time.spleep(3)" in localrepo.addchangegroup before the changegroup manifest are
  written for example.
The test as it is has thus no value as automatic test case.

The necessary sleep could be added by a hook, but test-pending.t already tests
that.
2012-04-23 01:39:26 +02:00
Mads Kiilerich
41e384d611 tests: remove race in test-pull-pull-corruption.t
The output from the background process was not always interleaved "correctly"
with output from the foreground process.
2012-04-23 01:39:26 +02:00
Mads Kiilerich
9571ceabc0 tests: fix bashism in test-convert-splicemap.t
This should have been caught by check-code.
2012-04-23 01:39:26 +02:00
Adrian Buehlmann
66bff3361f commit: use ui.configbool when checking 'commitsubrepos' setting on --amend
Before this fix, having

   [ui]
   commitsubrepos = False

in the config file lead to

   $ hg ci --amend -mx
   abort: cannot amend recursively
2012-04-21 10:23:47 +02:00
Thomas Arendsen Hein
243e5232c0 opener: coding style, use triple quotes for doc string 2012-04-18 15:16:15 +02:00
Adrian Buehlmann
104162e2b1 pure/osutil: use Python's msvcrt module (issue3380)
As proposed by Christophe Gouiran <christophe.gouiran@eurocopter.com>
2012-04-19 17:08:12 +02:00
Idan Kamara
a5b84a16ff commands: add missing wlock to graft 2012-04-19 18:11:48 +03:00
Idan Kamara
62440b9ac3 dirstate: write branch file atomically 2012-04-19 18:11:42 +03:00
Idan Kamara
5db73f60d8 commands: add missing wlock to branch 2012-04-19 17:59:23 +03:00
Idan Kamara
09faf4a623 commands: add missing wlock to backout 2012-04-19 17:59:23 +03:00
FUJIWARA Katsunori
c7ab63f3a6 i18n: show localized messages for commands/extensions in hgweb help top (issue3383)
in hgweb help top page, help topics are localized, but abstracts of
commands and extensions are not, although these are already
translated.

it is because localized messages for them should be explicitly looked
up by original ones.

this patch looks localized messages up for each commands/extensions.
2012-04-19 20:54:56 +09:00
Angel Ezquerra
60d6e7877d revert: show warning when reverting subrepos that do not support revert
The warning is similar to the warning that was shown before hgsubrepo revert
support was added, with the exception that now the subrepo type is shown.

For example, when trying to revert a git subrepo located in "include/mygitsub",
the warning message would be:

include/mygitsub: reverting git subrepos is unsupported
2012-04-19 23:36:42 +02:00
Bryan O'Sullivan
6dd793955c revset: fix O(n**2) behaviour of bisect() (issue3381) 2012-04-18 21:27:35 -07:00
Patrick Mezard
6067403d0d convert/svn: do not try converting empty head revisions (issue3347)
Subversion conversion works by picking trunk and branches heads, computing a
revision graph from them and converting the selected commits. By design we fail
to convert empty revisions so we have to be careful when discovering the
revision graph. In this particular issue, the source svn repository was a
partial mirror made by svnsync. The funny part is svnsync preserves all
revisions including empty ones. Also, we trusted ra.stat(path,
stop).created_rev to give us the latest revision with changes in path history
up to stop. This assumption broke at least when path is '', that is the
repository root, which always returned 'stop' revision despited being empty.

The workaround is to first trust ra.stat() but if the returned revision appear
empty, search the whole path history from stop to r1 until some changes are
found.
2012-04-18 14:04:58 +02:00
Patrick Mezard
b8a30fde3a convert/svn: refactor svn_source.latest() with a nested function
We will call it more than once for reasons detailed later.
2012-04-18 14:04:58 +02:00
Patrick Mezard
d11f49e922 convert/svn: clarify svn_source.latest() stop arg default value
stop=0 could pass for a valid default value at first sight.
2012-04-18 14:04:57 +02:00
Steven Stallion
adee5af180 factotum: rename mount and path configuration entries
The factotum extension used mount and path entries which were too
generic. These have been replaced by mountpoint and executable
(respectively) to match existing conventions.
2012-04-17 21:12:37 -07:00
Matt Mackall
9b8a43a58b Added signature for changeset 51c1bb93bd38 2012-04-18 11:46:23 -05:00