Commit Graph

441 Commits

Author SHA1 Message Date
Pierre-Yves David
a1985448ad clfilter: enforce hidden changeset globally
The dispatch code now enables filtering of "hidden" changesets globally. The
filter is installed before command and extension invocation. The `--hidden`
switch is now global and disables this filtering for any command.

Code in log dedicated to changeset exclusion is removed as this global filtering
has the same effect.
2013-01-08 20:37:37 +01:00
Pierre-Yves David
ad252eff44 log: use "hidden" filtering instead of manual check at display time
When log is not given the --hidden option, hidden revision are not shown. We
move the implementation from manual checking at display time to changelog
filtering.

This is the first official usage of the hidden filtering.
2013-01-07 19:24:36 +01:00
Pierre-Yves David
d66193718e cmdutil: make options argument optional
There is not reason to force passing of an empty options list.
2013-01-04 13:48:07 +01:00
Matt Mackall
fe2cbf4904 merge with stable 2013-01-02 00:24:28 -06:00
Pierre-Yves David
b6d4017a84 amend: prevent loss of bookmark on failed amend
The active bookmark were moved to the temporary commit. When the transaction
were rollbacked, the bookmark were lost.

We now temporarly disable the bookmark to prevent this effect.
2012-12-30 03:49:15 +01:00
Pierre-Yves David
6a1ec255bb amend: invalidate dirstate in case of failure (issue3670)
The temporary commit created by amend update the dirstate. If the final commit
fails, we need to invalidate the change made to the dirstate, otherwise the
release of the wlock will write the dirstate created after the rollbacked
temporary commit.

This dirstate writing logic should probably be handled in the same object than
the transaction one. However such change are too big for stable.
2012-12-29 18:00:18 +01:00
Siddharth Agarwal
2b9ccce531 cmdutil: make getgraphlogrevs limit-aware
For a repository with over 400,000 changesets, this speeds up graphlog with a
small limit by around 0.05 seconds (~50%).
2012-12-28 16:25:12 -08:00
Siddharth Agarwal
aa52ffdc89 cmdutil: stop pretending we can calculate revs for graphlog lazily
cmdutil.getgraphlogrevs does a ton of work trying to build a graphlog lazily,
and then cmdutil.graphlog comes along and destroys all of that.
graphmod.dagwalker requires that it be given the full list of revs upfront so
that it can perform filtering and tests against known revs.

For a repository with over 400,000 changesets, this speeds up graphlog by
around 0.02 seconds (~20% with a small limit).
2012-12-28 16:25:00 -08:00
Siddharth Agarwal
1e67e6753f cmdutil: store a local ref to repo.hiddenrevs in getgraphlogrevs
On a repository with over 400,000 changesets, this speeds graphlog up by
around 0.03 seconds (~20% with a small limit).
2012-12-28 16:24:36 -08:00
Siddharth Agarwal
9302d9c2b3 cmdutil: make getgraphlogrevs return revs in descending order 2012-12-28 14:46:58 -08:00
FUJIWARA Katsunori
b81a7802fd subrepo: add argument to "diff()" to pass "ui" of caller side (issue3712) (API)
Color extension achieves colorization by overriding the class of
"ui" object just before command execution.

Before this patch, "diff()" of abstractsubrepo and classes
derived from it has no "ui" argument, so "diff()" of hgsubrepo
uses "self._repo.ui" to invoke "cmdutil.diffordiffstat()".

For separation of configuration between repositories, revision
1498948ee815 changed the initialization source of "self._repo.ui"
from "ui"(overridden) to "baseui"(plain) of parent repository.
And this caused break of colorization.

This patch adds "ui" argument to "diff()" of abstractsubrepo and
classes derived from it to pass "ui" object of caller side.
2012-11-30 00:43:55 +09:00
Pierre-Yves David
cc961a38fb amend: force editor only if old message is reused (issue3698)
This regression was added by 435d13b1e757. It triggered the editor even if
--message or --logfile were provided.
2012-11-13 08:41:56 -08:00
Kevin Bullock
e8ece086e3 merge with stable 2012-12-04 11:19:32 -06:00
FUJIWARA Katsunori
ff00b9869d i18n: add "i18n" comment to column positioning messages of "hg log"
This comment makes it easier to distinguish such messages from others
for message translators.
2012-10-31 03:59:27 +09:00
Augie Fackler
167f9d08c6 Merge with crew-stable. 2012-11-13 19:32:53 -06:00
Augie Fackler
9766845689 bookmarks: introduce a bmstore to manage bookmark persistence
Bookmarks persistence still showed a fair amount of its legacy as a
monkeypatching extension. This encapsulates all bookmarks
serialization and parsing in a single class, and offers a single
location where other bookmarks storage engines can be substituted
in. As a result, many files no longer import the bookmarks module,
which strikes me as an encapsulation win.

This doesn't do anything to the current bookmark state yet, but I'm
hoping put that in the bmstore class as well.
2012-11-07 16:21:39 -06:00
Pierre-Yves David
ca37867983 amend: fix incompatibity between logfile and message option (issue3675)
Bug introduced by 435d13b1e757
2012-10-24 15:37:32 +02:00
Pierre-Yves David
5f47fc1c50 amend: do a bare kill of temporary changeset
Before this changeset the temporary changeset created by amend was made a
precursors on the amend result. This add unnecessary complexity to the
obsolescence graph. This temporary commit will probably disappear in the future.
It is an unwanted byproduct of amend that nobody cares about.
2012-10-18 17:54:34 +02:00
Pierre-Yves David
9827da9933 amend: add noise in extra to avoid creating obsolescence cycle (issue3664)
Obsolescence cycle are bad and should be avoided as much as possible. The
current amend implemented touch changeset meta data as few as possible. This
make is easy for amend to result in the same node than a precursors. We add some
deterministic noise in extra to avoid this. In practice, the hex of the amended
changeset is stored in 'amend_source' extra key.
2012-10-18 22:12:15 +02:00
Sean Farley
a5e6af16d7 color: add additional changeset.phase label to log.changeset and log.parent
This allows the user to set different colors for each phase, e.g.

[color]
changeset.public = blue
changeset.draft = green
changeset.secret = red

In addition, this doesn't affect current configuration for custom log.changeset
colors, but rather adds the option for users that want to visually see which
changesets are amendable.
2012-10-16 13:35:58 -05:00
smuralid
d42ff23b07 log: speed up hg log for untracked files (issue1340)
'hg log' on untracked files tends to be fairly slow. The root cause is that we end up using the 'slowpath' when we can't find a revlog for the files listed. This could happen if the file in question is an untracked file, or it is a directory.
This diff tries to speed up 'hg log' (by avoiding the slowpath) for files if we can determine if that file is not (and was never) a directory. We use the previously added store.__contains__ methods to test if the directory exists (or existed) in the store.
To avoid changing any existing semantics, this 'optimization' kicks in only when none of the files listed as arguments to the hg log command exist in the store.
2012-09-13 23:50:45 -07:00
Pierre-Yves David
6a88d239df clfilter: remove any explicit revision number from default cmdutil range
Revision "0" and "-1" may be filtered, we can't use them in any default
revrange.
2012-09-03 14:29:05 +02:00
Pierre-Yves David
df82aab75f clfilter: remove usage of range in favor of iteration over changelog
If we want to apply filtering at changelog level, we need to iterate over it.
See previous changeset description for details.
2012-09-20 19:01:53 +02:00
Pierre-Yves David
e5780b8f05 amend: add obsolete support
If the obsolete feature is enabled, `hg commit --amend` marks a
changeset as obsolete instead of stripping it.
2012-09-11 00:12:07 +02:00
Pierre-Yves David
6675d5b644 amend: use an explicit commit message for temporary amending commit
Before this changeset, the extra commit created during amend had
the same description as the final commit. This was a bit confusing
when trying to understand what that extra commit was about.

This changeset changes the description of such commit to:

    temporary amend commit for <ammend-commit-hash>

The old behaviour was not a big deal, but would become more confusing
once we use obsolescence marker instead of stripping the precursors.

This also helps if the user restores a strip backup.
2012-08-25 16:20:41 +02:00
Pierre-Yves David
d67eeabf85 amend: wrap all commit operations in a single transaction
This allows proper recovery of an interrupted amend process.
No changes are made to the logic besides:

- indent operations into a single try-except clause,
- some comment and code wrapping to 80 chars,
- strip logic should not be contained in the transaction and is extracted from
  the main code.
2012-09-10 23:44:24 +02:00
Pierre-Yves David
c2caef51a8 amend: lock the repository during the whole process
Without this changes another writer can lock the repository in the middle the
amend process. The resulting mess can be pretty ugly.
2012-08-25 15:37:28 +02:00
Patrick Mezard
f64e7c7ee8 Merge with stable 2012-09-09 12:35:06 +02:00
Pierre-Yves David
ef39934b8c amend: preserve phase of amended revision (issue3602)
New commit from the amend process were created without any phase contraint. If
the amended changeset had a different phase from it's parent, the phases data
were lost.

The changeset ensure the new commit are created in the same phase than the
original changeset.
2012-08-30 16:47:08 +02:00
Ankur Dahiya
8c0a7c1aaf color: enabled color support for export command (issue1507)
The export command didn't output the diffs in color, even when color support
was enabled. This patch fixes that by making the export command use the default
ui.write method, instead of directly manipulating the ui.fout file object.
Also added a test case to verify color output to test-export.t.
2012-08-27 09:37:49 -07:00
Ross Lagerwall
661779d660 util: replace util.nulldev with os.devnull
Python since 2.4 has supported os.devnull so having util.nulldev
is unnecessary.
2012-08-04 07:14:40 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Patrick Mezard
33ee7f119d log: make opts entries optional (issue2423) 2012-08-01 15:49:00 +02:00
Pierre-Yves David
edc2b520d9 hidden: move hiddenrevs set on the repository
This set is always accessed through the repo for now. Having this set
carried by the changelog make it complicated to:

- initialize it, computing hidden set may involve revset call
- lazy compute it, (1) only the changelog can detect someone access it,
                   (2) only the repo have enought knowledge to compute it.

In later version I expect he changelog to apply filtering itself and the set to
be carried by changelog again.
2012-07-16 17:44:46 +02:00
Joshua Redstone
30df933365 scmutil: 25% speedup in casecollisionauditor
On a large repository, switching casecollisionauditor to lowercasing all file
names at once rather than one at a time improves hg-add time by 25%.
2012-07-06 13:56:40 -07:00
Patrick Mezard
1bc1374fa9 incoming/outgoing: handle --graph in core 2012-07-11 18:22:07 +02:00
Patrick Mezard
ea80881882 log: support --graph without graphlog extension
The glog command is preserved in the extension for backward compatibility.
2012-07-14 19:09:22 +02:00
Patrick Mezard
2d4a0ad972 graphlog: extract revset/support functions into cmdutil 2012-07-14 18:55:21 +02:00
Matt Mackall
61aa1f42b8 merge with stable 2012-06-29 00:40:52 -05:00
Idan Kamara
bcb7450401 amend: disable hooks when creating intermediate commit (issue3501) 2012-06-23 19:57:29 +03:00
Martin Geisler
50cde07b26 cmdutil: lowercase finddate status message
This message is output by 'hg revert -d DATE' and 'hg update -d DATE'.
2012-06-12 14:18:18 +02:00
Patrick Mezard
eb2318522a cmdutil: extract increasing_windows() from walkchangerevs()
It will be reused in the revset-based version.
2012-05-08 22:43:44 +02:00
Patrick Mezard
2cddd7a828 cmdutil: use filectx.cmp() in amend() 2012-05-13 13:19:46 +02:00
Matt Mackall
05e48d4041 merge with stable 2012-05-13 12:52:24 +02:00
Brodie Rao
92158e04de cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
Matt Mackall
48471fd098 merge with stable 2012-05-12 00:06:11 +02:00
Idan Kamara
c69934e20c amend: preserve extra dict (issue3430) 2012-05-11 18:33:45 +03:00
Kevin Bullock
cce50f4d35 revert: don't re-create changeset context 2012-05-04 09:20:28 -05:00
Patrick Mezard
bf0d75c9d1 amend: fix copy records handling (issue3410)
Messing with the dirstate before the intermediate commit seems error prone.
Instead, commit and recompute the copies with copies.pathcopies(), then use
that with commitctx().

Since copies.pathcopies() does not support file replacement very well, the
whole .renamed() condition in samefile() is removed and the "file replacement
caused by differing copy source" effect is discarded.

Test shamelessly stolen from Idan Kamara <idankk86@gmail.com>
2012-04-30 20:45:45 +02:00
Patrick Mezard
2c65c226cf localrepo: add setparents() to adjust dirstate copies (issue3407)
The fix introduced in 3509b9cf8f86 was only partially successful. It is correct
to turn dirstate 'm' merge records into normal/dirty ones but copy records are
lost in the process. To adjust them as well, we need to look in the first
parent manifest to know which files were added and preserve only related
records. But the dirstate does not have access to changesets, the logic has to
moved at another level, in localrepo.
2012-04-29 22:25:55 +02:00