Commit Graph

91 Commits

Author SHA1 Message Date
Patrick Mezard
e9454c243f revlog: fix partial revision() docstring (from f4a6c9197dbd) 2012-04-13 10:14:59 +02:00
Matt Mackall
055cba03a8 revlog: allow retrieving contents by revision number 2012-04-08 12:38:02 -05:00
Pierre-Yves David
27796a9924 bundlerepo: bundle repos should be non-publishing (issue3266)
Bundle repo contains both the bundle content and the content of the repository
used as a base. This create bugs with phases exchange because the "remote"
repository claim to contains changeset it does not. The easiest way to fix this
bug is to ensure a bundle repo as non publishing. This way changeset will be
seen in the same phase than locally.

This patch does not alter in which phase bundle revision are seen. For now they
are seen as if an old client had add them on the remote: They inherit their
phase from parent whatever the parent is. This is to be fixed in a later patch
2012-02-29 14:41:11 +01:00
Matt Mackall
ad7d6a7360 bundlerepo: try to find containing repo on creation (issue1812) 2012-01-31 17:25:37 -06:00
Sune Foldager
b1f5c2e814 bundlerepo: don't write branch cache to disk
Calling branchmap() or similar on a bundlerepo would write the bundle-augmented
branch cache to disk, requiring a subsequent expensive rebuild when the repo
is used without the bundle.
2011-12-01 14:17:17 +01:00
Sune Foldager
2a9298df3c bundlerepo: add argument check before unlink
The default argument value of None, for bundlename, would cause an exception.
Callers currently pass an empty string, thus dodging this problem.
2011-09-14 13:51:50 +02:00
Martin Geisler
af8a35e078 check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
Peter Arrenbrecht
fedeff28a1 bundlerepo: make getremotechanges support filtering of incoming
Extensions can hook discovery.findcommonincoming to filter out unwanted remote
changesets. This patch makes getremotechanges respect the changed remote heads
returned by such extensions.
2011-05-23 20:35:10 +02:00
Sune Foldager
3a06c3752e filelog: add file function to open other filelogs 2011-05-10 17:38:58 +02:00
Peter Arrenbrecht
cf46703488 bundlerepo: fix closing and docstring of getremotechanges
I did not in fact implement what I documented about closing of the
original repo. And there was a bit of leftover from an older version
of the API.
2011-05-04 20:14:30 +02:00
Peter Arrenbrecht
66c54cef75 bundlerepo: fix and improve getremotechanges
Fixes the regression where incoming could show local changes
introduced by rev eecf03f0ef7c.
2011-05-02 12:36:23 +02:00
Matt Mackall
27ba9c3d56 bundlerepo: drop struct 2011-05-01 13:08:29 -05:00
Benoit Boissinot
b805aced54 unbundler: separate delta and header parsing
Add header parsing for changelog and manifest (currently no headers might
change for next-gen bundle).
2011-04-30 19:01:24 +02:00
Benoit Boissinot
b2bd302b99 bundlerepo: port to new bundle API 2011-04-30 10:41:06 +02:00
Brodie Rao
b7f0d2a103 url: move URL parsing functions into util to improve startup time
The introduction of the new URL parsing code has created a startup
time regression. This is mainly due to the use of url.hasscheme() in
the ui class. It ends up importing many libraries that the url module
requires.

This fix helps marginally, but if we can get rid of the urllib import
in the URL parser all together, startup time will go back to normal.

perfstartup time before the URL refactoring (707e4b1e8064):

! wall 0.050692 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

current startup time (9ad1dce9e7f4):

! wall 0.070685 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

after this change:

! wall 0.064667 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
2011-04-30 09:43:20 -07:00
Peter Arrenbrecht
b867e650e6 discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Idan Kamara
762d333ae9 eliminate various naked except clauses 2011-04-23 00:51:25 +03:00
Brodie Rao
3a43fa887e url: refactor util.drop_scheme() and hg.localpath() into url.localpath()
This replaces util.drop_scheme() with url.localpath(), using url.url for
parsing instead of doing it on its own. The function is moved from
util to url to avoid an import cycle.

hg.localpath() is removed in favor of using url.localpath(). This
provides more consistent behavior between "hg clone" and other
commands.

To preserve backwards compatibility, URLs like bundle://../foo still
refer to ../foo, not /foo.

If a URL contains a scheme, percent-encoded entities are decoded. When
there's no scheme, all characters are left untouched.

Comparison of old and new behaviors:

URL                      drop_scheme()   hg.localpath()    url.localpath()
===                      =============   ==============    ===============
file://foo/foo           /foo            foo/foo           /foo
file://localhost:80/foo  /foo            localhost:80/foo  /foo
file://localhost:/foo    /foo            localhost:/foo    /foo
file://localhost/foo     /foo            /foo              /foo
file:///foo              /foo            /foo              /foo
file://foo               (empty string)  foo               /
file:/foo                /foo            /foo              /foo
file:foo                 foo             foo               foo
file:foo%23bar           foo%23bar       foo%23bar         foo#bar
foo%23bar                foo%23bar       foo%23bar         foo%23bar
/foo                     /foo            /foo              /foo

Windows-related paths on Windows:

URL                      drop_scheme()   hg.localpath()    url.localpath()
===                      =============   ==============    ===============
file:///C:/foo           C:/C:/foo       /C:/foo           C:/foo
file:///D:/foo           C:/D:/foo       /D:/foo           D:/foo
file://C:/foo            C:/foo          C:/foo            C:/foo
file://D:/foo            C:/foo          D:/foo            D:/foo
file:////foo/bar         //foo/bar       //foo/bar         //foo/bar
//foo/bar                //foo/bar       //foo/bar         //foo/bar
\\foo\bar                //foo/bar       //foo/bar         \\foo\bar

Windows-related paths on other platforms:

file:///C:/foo           C:/C:/foo       /C:/foo           C:/foo
file:///D:/foo           C:/D:/foo       /D:/foo           D:/foo
file://C:/foo            C:/foo          C:/foo            C:/foo
file://D:/foo            C:/foo          D:/foo            D:/foo
file:////foo/bar         //foo/bar       //foo/bar         //foo/bar
//foo/bar                //foo/bar       //foo/bar         //foo/bar
\\foo\bar                //foo/bar       //foo/bar         \\foo\bar

For more information about file:// URL handling, see:
http://www-archive.mozilla.org/quality/networking/testing/filetests.html

Related issues:

- issue1153: File URIs aren't handled correctly in windows

  This patch should preserve the fix implemented in
  5c92d05b064e. However, it goes a step further and "promotes"
  Windows-style drive letters from being interpreted as host names to
  being part of the path.

- issue2154: Cannot escape '#' in Mercurial URLs (#1172 in THG)

  The fragment is still interpreted as a revision or a branch, even in
  paths to bundles. However, when file: is used, percent-encoded
  entities are decoded, so file:test%23bundle.hg can refer to
  test#bundle.hg ond isk.
2011-03-30 20:03:05 -07:00
Peter Arrenbrecht
8f2d068a05 discovery: avoid discovery when local graph is a subset of remote
Immediately sends local's heads to the server to check whether the server knows them all.
If it does, we can call getbundle immediately.

Interesting test output changes are:

-  added 1 changesets with 0 changes to 1 files (+1 heads)
+  added 1 changesets with 0 changes to 0 files (+1 heads)

-> The new getbundle() actually fixes a bug vs. changegroupsubset() in that it no longer
returns unnecessary files when file revs are reused.

warning: repository is unrelated
+  requesting all changes

-> The new use of common instead of bases correctly indicates that an unrelated pull
gets all changes from the server.
2011-03-23 16:06:55 +01:00
Adrian Buehlmann
9e0069c080 Make sure bundlerepo doesn't leak temp files (issue2491)
Add empty repository.close() and call it in dispatch.

Remove bundlerepository.__del__(), merging it into bundlerepository.close(),
which overrides repository.close().

http://docs.python.org/reference/datamodel.html says:

"It is not guaranteed that __del__() methods are called for objects that
still exist when the interpreter exits."
2011-02-12 10:58:11 +01:00
Adrian Buehlmann
3f7ac1d848 bundlerepo: use less intrusive util.posixfile to open bundle 2011-01-07 10:48:30 +01:00
Klaus Koch
ac02ce2890 bundlerepository: get rid of temporary bundle files (issue2478)
This bug was introduced in a768ccd401c8 and 90b501357394.
2010-11-07 20:18:57 +01:00
Martin Geisler
59ef340ccd bundlerepository: test self.tempfile field, not tempfile module
This error was introduced in 1893dad24f90.
2010-11-10 15:38:00 +01:00
Nicolas Dumazet
15e204f50d bundlerepo: unify common code into a new getremotechanges
The pattern where we fetch incoming remote changes and return
them as a local bundlerepo seems common. It's nicer to have this
code unified.
2010-10-14 22:41:43 +02:00
Matt Mackall
cdb9f7c881 bundlerepo: restore close() method 2010-09-20 16:14:05 -05:00
Matt Mackall
4b4d939b00 bundle: get rid of chunkiter 2010-09-19 12:51:54 -05:00
Matt Mackall
43940bec52 bundle: make getchunk() a method 2010-09-18 18:20:34 -05:00
Matt Mackall
10fc9a1867 bundlerepo: use bundle objects everywhere 2010-09-17 19:24:29 -05:00
Matt Mackall
40f75a026a bundlerepo: drop unused close() method 2010-09-17 19:03:13 -05:00
Matt Mackall
60627b799a bundlerepo: remove duplication of bundle decompressors 2010-08-25 16:55:54 -05:00
Alexander Solovyov
f11ee5abee expand paths to local repository or bundle in appropriate classes
This avoids problem with unexpanded paths when it's not possible to
expand it at higher level (for example, if file:~/path/ is supplied as
path in schemes).
2009-12-07 12:31:45 +02:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Benoit Boissinot
61f058fa0c bundlerepo: keep the bundlerevlog interface in sync with revlog 2009-10-31 16:42:51 +01:00
Sune Foldager
acad01d54e bundlerepo: fix small bug in exception raising 2009-10-27 10:33:41 +01:00
Martin Geisler
ae0794fd45 coding style: use a space after comma
I left a cases like 'lambda x,y:' alone -- the lack of a space does
not bother me as much when the variables are single letters.
2009-07-22 23:12:54 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Matt Mackall
a2f3734c4c localrepo: use propertycache 2009-04-29 20:47:15 -05:00
Martin Geisler
2c8901a1b9 turn some comments back into module docstrings 2009-04-26 01:24:49 +02:00
Martin Geisler
8e4bc1e9ad put license and copyright info into comment blocks 2009-04-26 01:13:08 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Peter Arrenbrecht
bc21361ed2 cleanup: drop unused imports 2009-03-23 13:12:07 +01:00
Matt Mackall
7d51e0b1f6 bundlerepo: reintroduce dirstate 2009-03-17 13:43:11 -05:00
Matt Mackall
e0735a1762 error: move repo errors
rename NoCapability to CapabilityError
2009-01-12 10:42:31 -06:00
Matt Mackall
d15d559b7c errors: move revlog errors
- create error.py for exception classes to reduce demandloading
- move revlog exceptions to it
- change users to import error and drop revlog import if possible
2009-01-11 22:48:28 -06:00
Dirkjan Ochtman
35a7a2d857 bundlerepo doesn't really have a dirstate, throw AttributeError if requested 2008-11-27 16:07:17 +01: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
Peter Arrenbrecht
892bff8c6e drop superfluous param from revlog.addgroup() 2008-06-05 16:25:11 +02:00
Benoit Allard
22f4c84650 add support for HG10GZ bundles to bundlerepo.bundlerevlog() 2008-04-24 11:48:07 +02:00