Commit Graph

17064 Commits

Author SHA1 Message Date
Patrick Mezard
f1c5b9a95f patchbomb: rewrite getoutgoing() with revsets
Another version could have returned a revset expression from
getoutgoing(), but we do not know how many times it will be resolved, so
better do it once explicitely.
2012-06-24 18:11:52 +02:00
Patrick Mezard
3743817d12 patchbomb: support --outgoing and revsets
With --outgoing, input revisions were passed to getoutgoing() before
being resolved.
2012-06-24 17:39:27 +02:00
Patrick Mezard
10fef3c556 patchbomb: make --outgoing ignore secret changesets
getoutgoing() is just rewritten almost like revset.outgoing(), a
follow-up will make it use revsets after the tests are adjusted.
2012-07-14 19:21:31 +02:00
Matt Mackall
c0bdd10df1 merge with stable 2012-07-15 14:48:50 -05:00
Pierre-Yves David
9e13d2931c obsolete: compute extinct changesets
`extinct` changesets are obsolete changesets with obsolete descendants only. They
are of no interest anymore and can be:

- exclude from exchange
- hidden to the user in most situation
- safely garbage collected

This changeset just allows mercurial to detect them.

The implementation is a bit naive, as for unstable changesets. We better use a
simple revset query and a cache, but simple version comes first.
2012-07-06 19:34:09 +02:00
Pierre-Yves David
3f157ec6fb push: refuse to push unstable changesets without force
User should resolve unstability locally before pushing the same way we encourage
user to merge locally instead of pushing a new remote head.

If we are to push obsolete changeset, at least one set of the pushed set will be
either obsolete or unstable. The check is narrowed to only heads.
2012-07-10 01:39:03 +02:00
Wagner Bruna
243b1101bd convert: make filemap renames consistently override revision renames
When the source repository had a revision renaming "$new -> $old",
but the filemap a "$old -> $new" rename, the converted revision could
use either $new (deleting the file) or $old (keeping the file) when
getting the file data, depending on the lexicographical order of
those names. So the resulting revision would leave some files
untouched (as expected), but delete others arbitrarely.
2012-07-06 01:14:02 -03:00
Adrian Buehlmann
18cf0b55ff revert: use term "uncommitted merge" in help text
to make sure users can't possibly be mislead to try this for canceling a
*merge changeset*.
2012-07-09 17:51:46 +02:00
Adrian Buehlmann
f4bd1660eb update: mention how update can be used to cancel an uncommitted merge 2012-07-10 21:26:18 +02:00
Adrian Buehlmann
bd2cde6763 update: move help text about parent revision higher up
emphasizing how important the parent revision is
2012-07-10 11:15:22 +02:00
Adrian Buehlmann
69f9a7e33f rollback: move examples and --force note in help into verbose section
Plain 'hg help rollback' now looks like this:

  $ hg help rollback
  hg rollback

  roll back the last transaction (dangerous)

      This command should be used with care. There is only one level of
      rollback, and there is no way to undo a rollback. It will also restore
      the dirstate at the time of the last transaction, losing any dirstate
      changes since that time. This command does not alter the working
      directory.

      Transactions are used to encapsulate the effects of all commands that
      create new changesets or propagate existing changesets into a repository.

      This command is not intended for use on public repositories. Once changes
      are visible for pull by other users, rolling a transaction back locally
      is ineffective (someone else may already have pulled the changes).
      Furthermore, a race is possible with readers of the repository; for
      example an in-progress pull from the repository may fail if a rollback is
      performed.

      Returns 0 on success, 1 if no rollback data is available.

  options:

   -n --dry-run do not perform actions, just print output
   -f --force   ignore safety measures
      --mq      operate on patch repository

  use "hg -v help rollback" to show more info
2012-07-11 09:12:31 +02:00
Adrian Buehlmann
427ff24c6f rollback: split off command example paragraph in help 2012-07-11 09:08:26 +02:00
Martin Geisler
37556a7588 subrepo: add missing newline in Git warning message 2012-07-12 09:58:40 +02:00
Pierre-Yves David
2444c95546 obsolete: compute unstable changeset
An unstable changeset is a changeset *not* obsolete but with some obsolete
ancestors.

The current logic to decide if a changeset is unstable is naive and very
inefficient. A better solution is to compute the set of unstable changeset with
a simple revset and to cache the result. But this require cache invalidation
logic. Simpler version goes first.
2012-07-06 00:18:09 +02:00
Pierre-Yves David
940b30d287 revset: add an obsolete symbol
This predicate matches obsolete changesets.

This is a naive implementation to be improved later.
2012-07-06 19:29:10 +02:00
Pierre-Yves David
34e21f9d79 push: refuse to push obsolete changesets
This is a first version. Simple but not very efficient.

Note that this changeset introduce the "obsolete" word in the UI.
2012-07-10 01:32:18 +02:00
Pierre-Yves David
8a22ab8e06 push: accept revset argument for --rev 2012-07-05 19:53:04 +02:00
Pierre-Yves David
6bb5e54b11 check-code: recognise %= as an operator 2012-07-06 19:48:19 +02:00
Simon Heimberg
387ef4195f tests: do exclude what is expected 2012-07-04 08:55:16 +02:00
Mads Kiilerich
6dedbb6378 parsers.c: remove warning: 'size' may be used uninitialized in this function
Some compilers / compiler options (such as gcc 4.7) would emit warnings:

mercurial/parsers.c: In function 'pack_dirstate':
mercurial/parsers.c:306:18: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized]
mercurial/parsers.c:306:12: warning: 'mode' may be used uninitialized in this function [-Wmaybe-uninitialized]

It is apparently not smart enough to figure out how the 'err' arithmetics makes
sure that it can't happen.

'err' is now replaced with simple checks and goto. That might also help the
optimizer when it is inlining getintat().
2012-07-06 00:48:45 +02:00
Patrick Mezard
8841f3e966 graphlog: remove unused ASCIIDATA constant
It was introduced by c094f330c014, returned by asciiformat() but never
read anywhere. 0997c9dc5951 stopped using it completely, and the
graphmod.CHANGESET type is passed through all functions.
2012-07-11 16:47:33 +02:00
Patrick Mezard
546816cafd graphlog: make functions private, fix names 2012-07-11 17:10:21 +02:00
Patrick Mezard
d7b241c3e7 graphlog: remove unused get_revs() function 2012-07-11 17:05:20 +02:00
FUJIWARA Katsunori
64cae05faf localrepo: use file API via vfs while ensuring repository directory
As a part of migration to vfs, this patch invokes some file API
indirectly via vfs, while ensuring repository directory in the
constructor of "localrepository" class.

New file API are added to "scmutil.abstractopener" class, because they
are also used via other derived classes than "scmutil.opener".

But "join()" is not yet defined other than "scmutil.opener" class,
because it should not be used via other opener classes yet.
2012-07-06 18:45:27 +09:00
FUJIWARA Katsunori
1c926cc201 localrepo: use "vfs" intead of "opener" while ensuring repository directory
As a part of migration to vfs, this patch uses "self.vfs" instead of
"self.opener", while ensuring repository directory in the constructor
of "localrepository" class.
2012-07-06 18:45:27 +09:00
FUJIWARA Katsunori
204c7d4046 localrepo: use the path relative to "self.vfs" instead of "path" argument
As a part of migration to vfs, this patch uses "self.root", which can
be recognized as the path relative to "self.vfs", instead of "path"
argument.

This fix allows to make invocations of "util.makedirs()" and
"os.path.exists()" while ensuring repository directory in
"localrepository.__init__()" ones indirectly via vfs.

But this fix also raises issue 2528: "hg clone" with empty destination.

"path" argument is empty in many cases, so this issue can't be fixed
in the view of "localrepository.__init__()".

Before this patch, it is fixed by empty-ness check ("not name") of
exception handler in "util.makedirs()".

    try:
        os.mkdir(name)
    except OSError, err:
        if err.errno == errno.EEXIST:
            return
        if err.errno != errno.ENOENT or not name:
            raise

This requires "localrepository.__init__()" to invoke "util.makedirs()"
with "path" instead of "self.root", because empty "path" is treated as
"current directory" and "self.root" becomes valid path.

But "hg clone" with empty destination can be detected also in
"hg.clone()" before "localrepository.__init__()" invocation, so this
patch re-fixes issue2528 by checking it in "hg.clone()".
2012-07-06 18:45:27 +09:00
FUJIWARA Katsunori
765d4328c8 localrepo: use "self.wvfs.join()" instead of "os.path.join()"
As a part of migration to vfs, this patch uses "self.wvfs.join()"
instead of "os.path.join()", while initialization of fields in the
constructor of "localrepository" class.
2012-07-06 18:45:27 +09:00
FUJIWARA Katsunori
d20072de6a localrepo: use path expansion API via vfs
As a part of migration to vfs, this patch moves path expansion API
invocations in the constructor of "localrepository" to the constructor
of "opener", because the root path to the repository is very important
to handle paths using non-ASCII characters correctly.

This patch also rearrange initialization order of "wvfs" field,
because it is required to initialize "self.root".
2012-07-06 18:45:27 +09:00
FUJIWARA Katsunori
dad1f854dd localrepo: add "vfs" fields to "localrepository" for migration from "opener"
As a part of migration to vfs, this patch adds "vfs" fields to
"localrepository" class.

This allows new codes to access current "opener" objects related to
repositories via "vfs" fields, so patches referring to "vfs" will
replace referring to "opener" in time.

This patch also adds initializations for "vfs" fields to
"statichttprepository" class derived from it, because its constructor
doesn't invoke the constructor of "localrepository", so "vfs" fields
should be initialized explicitly as same as "opener" fields: it has no
working directory, so "wvfs" field is not added.
2012-07-06 18:45:26 +09:00
Na'Tosha Bard
7bf5bfedef largefiles: optimize status by synchronizing lfdirstate with the largefile on update
This speeds up status on a largefiles repo by synchronizing the largefiles dirstate to the
largefile's mtime upon update, preventing the files from coming back as "unsure" later,
requiring a check of the SHA1 sum.
2012-07-13 14:49:16 +02:00
Matt Mackall
f6c512ceb4 Added signature for changeset 46cdcb89086f 2012-07-01 21:12:36 -05:00
Matt Mackall
921065f3f8 record: fix display of non-ASCII names
spotted by Nikolaj Sjujskij
2012-07-01 13:10:54 -05:00
Wagner Bruna
254de6d1aa i18n-pt_BR: synchronized with ef02254f0cee 2012-07-01 08:09:00 -03:00
Wagner Bruna
dee9edcd33 merge with i18n 2012-07-01 08:08:37 -03:00
FUJIWARA Katsunori
a7672f651e i18n-ja: fix some rst syntax problems 2012-07-01 00:04:46 +09:00
FUJIWARA Katsunori
7c967574b8 i18n-ja: synchronized with 30462c97bcea 2012-06-30 21:59:16 +09:00
Matt Mackall
6a10a5e3e4 merge with i18n 2012-06-26 14:50:16 -05:00
Thomas Arendsen Hein
cc4d20e368 subrepo/svn: make rev number retrieval compatible with svn 1.5 (issue2968)
dbc9f6aea991 introduced "svn info TARGET@REV" to determine if a certain
path exists in the specified revision, but in svn 1.5 the error message
"Not a valid URL" yields exit code 0 so the error is not caught.
Use "svn list TARGET@REV" instead which works with svn 1.5 and is even
faster in some situations.
2012-06-26 14:27:33 +02:00
Thomas Arendsen Hein
90f293b489 convert/bzr: make tests work with bzr 2.0 again
bzr ci --commit-time was introduced in 2.1
bzr add without -q prints "adding" in 2.1, "added" in 2.0
2012-06-26 12:17:40 +02:00
Bryan O'Sullivan
9c4291ed97 store: abstract out how we retrieve a file's size 2012-06-25 15:14:06 -07:00
FUJIWARA Katsunori
54911ad11a mq: check subrepo synchronizations against parent of workdir or other appropriate context
Before this patch, MQ checks each subrepo synchronizations against the
working directory context, so ".hgsubstate" updating is not imported
into MQ revision correctly in cases below:

  - qrefresh when current ".hgsubstate" is already synchronized with
    each subrepos: you can reproduce this easily by just twice or more
    qrefresh invocations

  - qnew just after rollback of commit which updates ".hgsubstate"

This patch resolves this by checking subrepo states against:

  - the parent of "qtop" for qrefresh, or
  - the parent of working context otherwise
2012-06-27 22:03:27 +09:00
FUJIWARA Katsunori
8ecc1d9d04 mq: create patch file after commit to import diff of ".hgsubstate" at qrefresh
Even though the committed revision contains diff of ".hgsubstate", the
patch file created by qrefresh doesn't contain it, because:

  - ".hgsubstate" is not listed up as one of target files of the patch
    for reasons below, so diff of ".hgsubstate" is not imported into
    patch file

      - status of ".hgsubstate" in working directory is usually "clean"
      - ".hgsubstate" is not specified explicitly by users

  - the patch file is created before commit processing which updates
    or creates ".hgsubstate" automatically, so there is no diff for it
    at that time

This patch resolves this problem by:

  - putting ".hgsubstate" into target list of the patch, if needed:
    this allows "patch.diff()" to import diff of ".hgsubstate" into
    patch file.

  - creating the patch file after commit processing:
    this updates ".hgsubstate" before "patch.diff()" invocation.

For the former fixing, this patch introduces "putsubstate2changes()"
to share same implementation with qnew. This is invoked only once per
qnew/qrefresh at most, so there is less performance impact.

This patch also omits "match" argument for "patch.diff()" invocation,
because "patch.diff()" ignores "match" if "changes" is specified.
2012-06-27 22:03:27 +09:00
FUJIWARA Katsunori
fba032044a mq: add ".hgsubstate" to patch target list only if it is not listed up yet
If ".hgsubstate" is already listed up as one of commit targets, qnew
put diff of ".hgsubstate" twice into the patch file stored under
".hg/patches".

It causes rejections at applying such patches.

Other than the case like in added test script, this can also occur
when qnew is executed just after rolling back the committing updated
".hgsubstate".

This patch checks whether ".hgsubstate" is already listed up as one of
commit targets, and put it into the appropriate list only if it is not
listed up yet.
2012-06-27 22:03:22 +09:00
Matt Mackall
5b06da939f backout 94ae81a4e338
This may have allowed unbounded I/O sizes with the current chunk
retrieval code.
2012-07-12 14:20:34 -05:00
Martin Geisler
75be7b05da merge with crew-stable 2012-07-12 13:33:53 +02:00
Adrian Buehlmann
92055c96e6 histedit: use cmdutil.command decorator 2012-07-06 22:43:10 +02:00
Adrian Buehlmann
dad9940448 hgweb: show help with verbose sections included
This makes sure we see the same help info as with 'hg help <command> --verbose'
on the command line, that is, with verbose sections included.
2012-07-10 17:52:43 +02:00
Martin Geisler
0a036ffb67 merge with crew-stable 2012-07-12 10:41:56 +02:00
Martin Geisler
c52341ae3f merge with main 2012-07-12 10:03:50 +02:00
Bryan O'Sullivan
f2f0be709b Merge 2012-07-11 15:39:00 -07:00