Commit Graph

36 Commits

Author SHA1 Message Date
Patrick Mezard
0e57a866c2 repair: pass variable explicitely to nested function 2010-08-26 23:38:13 +02:00
Nicolas Dumazet
96827d742a repair: do not compress partial bundle if we do not keep it on disk
A partial bundle is created to temporarily save revisions > rev but
not descending from the node to strip, to be able to restore the
changesets after stripping the changelog.
Since this bundle is not kept after the strip operation, and is not
user-visible, it is not necessary and should be faster to avoid
compression.
2010-08-12 16:53:23 +09:00
Martin Geisler
8f362a460f mark ui.warn strings for translation 2010-07-16 14:44:30 +02:00
Matt Mackall
251885d01b strip: backup bundles should use the .hg extension 2010-06-10 15:23:31 -05:00
Matt Mackall
46429c0cb8 strip: hide unbundle messages by default
Unbundling is an internal implementation detail for strip, only show
them with --verbose.
2010-05-20 13:27:28 -05:00
Matt Mackall
a386dc3529 strip: improve full backup message 2010-05-20 12:15:44 -05:00
Matt Mackall
0a1ca665ca strip: be quiet about temporary internal bundle 2010-05-19 19:46:39 -05:00
Steve Borho
c7ec998a7b localrepo: add desc parameter to transaction
All callers to localrepo.transaction() must supply a transaction description.
The description and the existing repository tip are then stored
(transactionally) into .hg/undo.desc; where rollback can later find it.
2010-04-09 17:23:35 -05:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Greg Ward
0487eef6d6 localrepo: add destroyed() method for strip/rollback to use (issue548). 2009-07-16 10:39:41 -04:00
Brendan Cully
2c53914f62 Fix issue1738 for strip too.
I see no reason to open every touched file at once.
2009-07-14 17:58:36 -07:00
Martin Geisler
4176f5b789 replace xrange(0, n) with xrange(n) 2009-05-25 23:06:11 +02:00
Martin Geisler
7901628fb3 repair: bulk update sets
Use a single set.update and set.difference_update call instead of many
set.add and set.discard calls.
2009-05-17 16:55:51 +02:00
Benoit Boissinot
21c663ad08 repair: use set instead of dict 2009-05-17 03:38:03 +02:00
Henrik Stuart
ec8d726ba0 transaction: add atomic groups to transaction logic
When performing a strip operation on a repository, it is vital that all the
truncations are performed, or that none of them are. This is done by adding
support for writing a number of entries in a single operation.

Co-contributor: Sune Foldager <cryo@cyanite.org>
2009-05-11 21:12:40 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Henrik Stuart
c1e6537e5f strip: make repair.strip transactional to avoid repository corruption
Uses a transaction instance from the local repository to journal the
truncation of revlog files, such that if a strip only partially completes,
hg recover will be able to finish the truncate of all the files.

The potential unbundling of changes that have been backed up to be restored
later will, in case of an error, have to be unbundled manually. The
difference is that it will be possible to recover the repository state so
the unbundle can actually succeed.
2009-04-16 15:34:03 +02:00
Matt Mackall
b2807810c6 linkrev: take a revision number rather than a hash 2008-11-12 15:19:14 -06:00
Martin Geisler
28fb695e9a i18n: mark strings for translation in Mercurial 2008-08-31 16:12:02 +02:00
Matt Mackall
bc715be859 add __len__ and __iter__ methods to repo and revlog 2008-06-26 14:35:50 -05:00
Matt Mackall
fbb5127472 use repo[changeid] to get a changectx 2008-06-26 14:35:46 -05:00
Benoit Boissinot
9ac6d264fb fix warning from pychecker 2008-03-30 20:21:57 +02:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Alexis S. L. Carvalho
aa51bf2928 repair.py: rewrite a loop, making it cleaner and faster 2008-02-19 19:20:10 -03:00
Alexis S. L. Carvalho
ba985d288a simplify revlog.strip interface and callers; add docstring
Also, strip files only after the changelog and the manifest.
2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
8b35462ec9 strip: calculate list of extra nodes to save and pass it to changegroupsubset
When we remove revision N from the repository, all revisions >= N are
affected: either it's a descendant from N and will also be removed, or
it's not a descendant of N and will be renumbered.

As a consequence, we have to (at least temporarily) remove all filelog
and manifest revisions that have a linkrev >= N, readding some of them
later.

Unfortunately, it's possible to have a revlog with two revisions
r1 and r2 such that r1 < r2, but linkrev(r1) > linkrev(r2).  If we try
to strip revision linkrev(r1) from the repository, we'll also lose
revision r2 when we truncate this revlog.

We already use changegroupsubset to create a temporary changegroup
containing the revisions that have to be restored, but that function is
unable to detect that we also wanted to save the r2 in the case above.

So we manually calculate these extra nodes and pass it to changegroupsubset.

This should fix issue764.
2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
daf9afc324 repair.py: don't use nested functions. 2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
9b687a8fde repair.py: use revs in limitheads 2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
c9102dbdfb repair.py: add a docstring to bundle; use repo.ui 2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
57e493f050 repair.py: split stripall into two functions; clean it up a bit 2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
70423bc0ec repair.py: rename chlog to cl 2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
7bc2e3bde0 repair.py: nodes are nodes, revs are revs
Use "striprev" instead of just "rev" to make the patch a bit less
confusing.  This is also a bit clearer than just "revnum".
2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
14dec2c24b repair.py: use node.* directly 2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
7f21081e68 repair.py: don't import commands.py 2008-01-19 18:01:16 -02:00
Matt Mackall
9a11c35355 strip: move strip code to a new repair module 2007-06-25 01:26:44 -05:00