Commit Graph

27 Commits

Author SHA1 Message Date
liscju
d8406bc0f4 update: fix bare --clean to work on new branch (issue5003) (BC)
Before this commit bare update --clean on newly created branch
updates to the parent commit, even if there are later commits
on the parent commit's branch. Update to the latest head on the
parent commit's branch instead.

This seems reasonable as clean should discard uncommited changes,
branch is one of them.
2016-04-05 07:30:01 +02:00
Yuya Nishihara
51590b34c7 update: resurrect bare update from null parent to tip-most branch head
The situation is tricky if repository has no "default" branch, because "null"
revision belongs to non-existent "default" branch.

Before 9d20b43f7098, bare update from null would bring us to the tip-most
non-closed branch head. 9d20b43f7098 removed the special handling of missing
"default" branch since we wanted to stick to the uncommitted branch in that
case. But, if the parent is "null" revision, and if the missing branch is
"default", it shouldn't be an uncommitted branch. In this case, bare update
should bring us to the tip-most head as before.

This should fix the test breakage introduced by 9d20b43f7098.
2016-04-15 20:37:11 +09:00
liscju
4b86252e85 update: fix bare update to work on new branch
So far bare update on new branch results in
'abort: branch new-branch not found'. This commit fixes
this by updating to the parent of wctx.

The effect of updating to the parent of wctx is to move to the paren't
branch - this means that it is no longer necessary to prevent you from
updating if you would lose your newly created branch.
2016-04-05 06:53:33 +02:00
Matt Mackall
1b6a04b2ec branch: don't warn about branches if repository has multiple branches already
This warning exists to prevent git users from prematurely polluting
their namespace when trying out Mercurial. But for repos that already
have multiple branches, understanding what branches are is not
optional so we should just shut up.
2015-05-22 17:08:59 -05:00
Mads Kiilerich
9f8f9204ca tests: improve test coverage of branch command and existing branches 2014-08-29 12:17:53 +02:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Brodie Rao
a446720e09 branchmap: cache open/closed branch head information
This lets us determine the open/closed state of a branch without
reading from the changelog (which can be costly over NFS and/or with
many branches).
2013-09-16 01:08:29 -07:00
Kevin Bullock
93f9cb7f25 filtering: rename filters to their antonyms
Now that changelog filtering is in place, it's become evident that
naming the filters according to the set of revs _not_ included in the
filtered changelog is confusing. This is especially evident in the
collaborative branch cache scheme.

This changes the names of the filters to reflect the revs that _are_
included:

  hidden -> visible
  unserved -> served
  mutable -> immutable
  impactable -> base

repoview.filteredrevs is renamed to filterrevs, so that callers read a
bit more sensibly, e.g.:

  filterrevs('visible') # filter revs according to what's visible
2013-01-13 01:39:16 -06:00
Mads Kiilerich
641f4b8a6c localrepo: store branchheads sorted 2013-01-15 02:59:12 +01:00
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
4ba45ce409 clfilter: add impactable filter
The `mutable` filter still have some chance to get invalidated. This will happen
when:

- you garbage collect hidden changeset,
- public phase is moved backward,
- something is changed in the filtering (this could be fixed)

So we introduce an even more stable filtering set: everything with a revision
number egal or higher than the first mutable changeset is filtered.

The only official use of this filter is for branchcache.
2013-01-02 02:02:41 +01:00
Pierre-Yves David
047cb49651 clfilter: add mutable filtering
It filters all mutable changesets, leaving only public changeset unfiltered.
This filtering set is expected to be much more stable that the previous one as
public changeset are unlikely to disapear.

The only official use of this filter is for branchcache.
2013-01-02 01:57:46 +01:00
Pierre-Yves David
01b68ae973 branchmap: allow to use cache of subset
Filtered repository are *subset* of unfiltered repository. This means that a
filtered branchmap could be use to compute the unfiltered version.

And filtered version happen to be subset of each other:
- "all() - unserved()" is a subset of "all() - hidden()"
- "all() - hidden()" is a subset of "all()"

This means that branchmap with "unfiltered" filter can be used as a base for
"hidden" branchmap that itself could be used as a base for unfiltered
branchmap.

   unserved < hidden < None

This changeset implements this mechanism. If the on disk branchcache is not valid
we use the branchcache of the nearest subset as base instead of computing it from
scratch. Such fallback can be cascaded multiple time is necessary.

Note that both "hidden" and "unserved" set are a bit volatile. We will add more
stable filtering in next changesets.

This changeset enables collaboration between no filtering and "unserved"
filtering. Fixing performance regression introduced by 7bff5f37cb97
2013-01-07 17:23:25 +01:00
Pierre-Yves David
186fef84cd branchmap: improve invalid cache message when reading
This factors out the generation of the message. This helps future error reporting
when reading cache for filtered repository.
2012-12-28 00:13:32 +01:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Pierre-Yves David
1b001a85f3 changeset_printer: display changeset phase on debug level
Backward compatibility make it hard to display it on higher level
2012-01-17 20:23:23 +01:00
Matt Mackall
a69962e18c branch: warn on branching 2011-12-08 14:32:44 -06:00
Martin Geisler
823fefa7a6 commands: use util.Abort's hint some more 2011-05-05 14:57:21 +02:00
Peter Arrenbrecht
5fbc4a50f1 localrepo: reuse parent manifest in commitctx if no files have changed
This speeds up the in-memory version of debugbuilddag that I'm
working on considerably for the case where we want to build just
a 00changelog.i (for discovery tests, for instance).

There are a couple of test changes because node ids in tests
have changed.

The changes to the patch names in test-mq-qdelete.t were required
because they could collide with nodeid abbreviations and newly
actually do (patch "c" collides with id "cafe..." for patch "b").
2011-05-02 19:20:29 +02:00
Matt Mackall
81bd0b7967 merge: back out single-parent fast-forward merge
This backs out

 changeset:   13158:17d1b96c0f12
 user:        Mads Kiilerich <mads@kiilerich.com>
 date:        Tue Dec 07 03:29:21 2010 +0100
 summary:     merge: fast-forward merge with descendant

Before named branches, the invariants were:

a) "merges" always have two parents
b) p1 is not linearly related to p2

Adding named branches made (b) problematic, so the above patch was
introduced, which fixed (b) but broke (a).

After discussion, we decided that the invariants should be:

a) "merges" always have two parents
b) p1 is not linearly related to p2 OR p1 and p2 are on different branches
2011-03-07 15:03:10 -06:00
Wagner Bruna
0d89e80dea rollback, i18n: avoid parameterized message 2011-02-21 20:58:54 -03:00
Gilles Moris
dcdc58f0a5 rollback: clarifies the message about the reverted state (issue2628)
Previously, when rolling back a transaction, some users could be confused
between the level to which the store is rolled back, and the new parents
of the working directory.

  $ hg rollback
  rolling back to revision 4 (undo commit)

With this change:
  $ hg rollback
  repository tip rolled back to tip revision 4 (undo commit)
  working directory now based on revision 2 and 1

So now the user can realize that the store has been rolled back to an older
tip, but also that the working directory may not on the tip (here we are
rolling back the merge of the heads 2 and 1)
2011-02-10 09:03:06 +01:00
jfh
a52d7e5744 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
The generation of cache files like tags.cache and branchheads.cache is not an
actual reflection of things changing in the whole of the .hg directory (like eg
a commit or a rebase or something) but instead these cache files are just part
of bookkeeping. As such its convienant to allow various clients to ignore file
events to do with these cache files which would otherwise cause a double
refresh. Eg one refresh might occur after a commit, but the act of refreshing
after the commit would cause Mercurial to generate a new branchheads.cache which
would then cause a second refresh, for clients.

However if these cache files are moved into a directory like eg .hg/cache/ then
GUI clients on OSX (and possibly other platforms) can happily ignore file events
in this cache directory.
2011-01-04 06:29:08 +01:00
Mads Kiilerich
9772d9af5a merge: fast-forward merge with descendant
issue2538 gives a case where a changeset is merged with its child (which is on
another branch), and to my surprise the result is a real merge with two
parents, not just a "fast forward" "merge" with only the child as parent.

That is essentially the same as issue619.

Is the existing behaviour as intended and correct?

Or is the following fix correct?

Some extra "created new head" pops up with this fix, but it seems to me like
they could be considered correct. The old branch head has been superseeded by
changes on the other branch, and when the changes on the other branch is merged
back to the branch it will introduce a new head not directly related to the
previous branch head.

(I guess the intention with existing behaviour could be to ensure that the
changesets on the branch are directly connected and that no new heads pops up
on merges.)
2010-12-07 03:29:21 +01:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Sune Foldager
843894f4b3 tests: remove exec bit from .t files 2010-09-14 16:03:10 +02:00
Adrian Buehlmann
79059e20c1 combine tests 2010-09-14 12:20:51 +02:00