Matt Mackall
1f16099cd0
revlog: simplify revlog.__init__
...
- move stat into io helper
- get rid of self.defversion and self.indexstat
- fold _load into __init__
2007-07-23 20:44:08 -05:00
Matt Mackall
f3686b0a39
revlog: mark cache private
2007-07-23 20:44:08 -05:00
Matt Mackall
9a71ba31c4
revlog: pull chunkcache back into revlog
2007-07-23 20:44:08 -05:00
Matt Mackall
35c14c89a6
revlog: change _inline from a function to a variable
2007-07-23 20:44:08 -05:00
Matt Mackall
b51cdea681
revlog: simplify addrevision
...
- remove unused defaults for p1, p2, and text
- reduce some if/else
- use better variable names
- remove some extra variables
- remove some obsolete corner tests
- simply first entry handling for revlogng
- simply inline vs outofline writeout
2007-07-23 20:44:08 -05:00
Matt Mackall
0ab56eac5f
revlog: some codingstyle cleanups
2007-07-23 20:44:08 -05:00
Matt Mackall
2cb4c11520
revlog: add a magic null revision to our index
...
We expand our index by one entry so that index[nullrev] points to a
unique entry, the null revision. This naturally eliminates numerous
extra tests in the performance-sensitive index access functions, most
of which are now trivial again.
Adding new entries is now done with insert(-1, e) rather than
append(e).
2007-07-23 20:44:08 -05:00
Matt Mackall
f03d3e07aa
revlog: change accesses to index entry elements to use positive offsets
2007-07-23 20:44:08 -05:00
Matt Mackall
04b4378f47
revlog: parse revlogv0 indexes into v1 internally
...
This lets us eliminate lots of special case code in our
performance-sensitive index accessors.
2007-07-23 20:44:08 -05:00
Matt Mackall
70e7477200
revlog: only allow lazy parsing with revlogng files
...
This will allow us to store indices in memory in a single entry format
2007-07-23 20:44:08 -05:00
Matt Mackall
214f50b511
revlog: simplify the v1 immediate parser
...
- read all the data at once (large files are handled by the lazy parser)
- cache the entire file for inline revlogs
- simplify looping
2007-07-23 20:44:08 -05:00
Matt Mackall
3b9167f022
revlog: set the threshold for lazy parsing higher
...
A typical machine can parse a 1MB index in well under a second
2007-07-23 20:44:08 -05:00
Matt Mackall
1889aee8b0
revlog: simplify the v0 parser
2007-07-23 20:44:07 -05:00
Matt Mackall
e7ef5dc500
revlog: add revlogio interface
...
This lets us separate the logic for different on-disk revlog formats from
the main revlog logic.
2007-07-23 20:44:07 -05:00
Matt Mackall
2158f34c5f
revlog: regroup parsing code
2007-07-23 20:44:07 -05:00
Matt Mackall
3dfe783ec5
transactions: avoid late tear-down (issue641)
...
We use weak references (ugh) to avoid having to manually delete
transaction references out of each call frame when an exception occurs.
2007-07-22 14:53:57 -05:00
Thomas Arendsen Hein
b35814d4c2
merge with crew-stable
2007-07-22 09:45:18 +02:00
Bryan O'Sullivan
a09e8936ae
addremove: print meaningful error message if --similar not numeric
2007-07-21 19:07:18 -07:00
Matt Mackall
cd72dc7f1b
Merge with crew
2007-07-21 16:44:38 -05:00
Matt Mackall
d5b7eaa69a
revlog: privatize some methods
2007-07-21 16:18:42 -05:00
Matt Mackall
0e54e000c1
revlog: delete unused function makenode
2007-07-21 16:18:24 -05:00
Matt Mackall
9eea27ad83
revlog: raise offset/type helpers to global scope
2007-07-21 16:18:21 -05:00
Matt Mackall
3a3bd8ec5b
Make repo locks recursive, eliminate all passing of lock/wlock
2007-07-21 16:02:10 -05:00
Matt Mackall
3fdaa5a42e
Use a weakref for recursive transactions
2007-07-21 16:02:10 -05:00
Matt Mackall
3e13c68628
Use try/finally pattern to cleanup locks and transactions
2007-07-21 16:02:10 -05:00
Matt Mackall
5a93a0feb4
repo locks: use True/False
2007-07-21 16:02:09 -05:00
Matt Mackall
ce5b3192db
rename and simplify do_lock
2007-07-21 16:02:09 -05:00
Matt Mackall
7cdcc1b36f
simplify dirstate fixups in repo.status()
2007-07-21 16:02:09 -05:00
Matt Mackall
450dc6247d
dirstate: add doesn't need to call stat
2007-07-21 16:02:09 -05:00
Matt Mackall
60107c9e5e
use context for part of localrepo status
2007-07-21 16:02:09 -05:00
Matt Mackall
410e8d67c6
context: add __contains__, __getitem__, and __iter__
2007-07-21 16:02:09 -05:00
Matt Mackall
81e9f172fb
dirstate: get rid of default args for status
2007-07-21 16:02:09 -05:00
Matt Mackall
43547721ea
dirstate: make filterfiles private
2007-07-21 16:02:09 -05:00
Matt Mackall
c2967290a5
dirstate: add __contains__ and make __getitem__ more useful
...
dirstate.state(f) == '?' -> f not in dirstate
dirstate.state(f) -> dirstate[f]
2007-07-21 16:02:09 -05:00
Matt Mackall
bab511ec55
dirstate: make wjoin function private
2007-07-21 16:02:09 -05:00
Matt Mackall
cf691df912
dirstate: break update into separate functions
2007-07-21 16:02:09 -05:00
Matt Mackall
1a40b796d1
dirstate: use True and false for _dirty
2007-07-21 16:02:09 -05:00
Thomas Arendsen Hein
a974129de3
merge with crew-stable
2007-07-21 17:37:39 +02:00
Thomas Arendsen Hein
dbdc09ab03
Make [defaults] in .hg/hgrc work.
2007-07-21 17:36:45 +02:00
Thomas Arendsen Hein
def3b1c2ba
Use format string for lockname again (was changed by cb157328a155)
2007-07-21 10:39:42 +02:00
Thomas Arendsen Hein
d9d3256252
removed trailing whitespace
2007-07-21 10:30:51 +02:00
Benoit Boissinot
8c722d66b2
fix bogus close spotted by pychecker (no close() in global scope)
2007-07-20 09:44:50 +02:00
Benoit Boissinot
84d45c7794
fix unused variables reported by pychecker
2007-07-20 09:31:32 +02:00
Alexis S. L. Carvalho
afb05aff16
dirstate.invalidate: avoid rebuilding _map
...
Since hasattr will call __getattr__, the call to hasattr(self, '_dirs')
will end up reparsing the dirstate file.
2007-07-19 19:43:25 -03:00
Alexis S. L. Carvalho
534a817230
add dirstate._dirtypl variable
...
Theoretically, it's possible to forget modified dirstate
parents by doing:
dirstate.invalidate()
dirstate.setparents(p1, p2)
dirstate._map
The final access to _map should call _read(), which will
unconditionally overwrite dirstate._pl.
This doesn't actually happen right now because invalidate
accidentally ends up rebuilding dirstate._map.
2007-07-19 19:43:25 -03:00
Alexis S. L. Carvalho
563893de20
archive: delay extraction of file revisions
...
This allows us to look only at the filelogs we're interested in,
providing a nice speedup if we're archiving only part of a repository.
2007-07-19 19:43:25 -03:00
Alexis S. L. Carvalho
e0b6efcdbf
help: avoid traceback if an extension has only debug commands
2007-07-19 19:43:25 -03:00
Alexis S. L. Carvalho
a8e3b41c40
merge with crew-stable
2007-07-19 19:48:24 -03:00
Bryan O'Sullivan
a7c1cdf4bc
Print meaningful error message if os.symlink fails
2007-07-19 15:29:33 -07:00
Bryan O'Sullivan
cd2a579d50
lock.py: cache hostname, but not pid, in case we fork
2007-07-19 15:13:48 -07:00
Bryan O'Sullivan
8d0f81f7cc
Simplify update.
2007-07-18 14:00:55 -07:00
Bryan O'Sullivan
5930d0695b
Simplify update.
2007-07-18 14:00:55 -07:00
Bryan O'Sullivan
f645e069a4
Better fix for issue 622 than we had in 287a2fbd37b0.
2007-07-18 13:56:08 -07:00
Bryan O'Sullivan
261434d5a1
Better fix for issue 622 than we had in 287a2fbd37b0.
2007-07-18 13:56:08 -07:00
Patrick Mezard
dd336a8d1a
patch: patches should be read and written in binary mode when possible.
2007-07-17 23:35:24 +02:00
Patrick Mezard
ccc14e4990
patch: fix normalized paths separators.
2007-07-17 23:34:52 +02:00
Patrick Mezard
4a8150bcb8
posixfile_nt: '+' was understood as read mode instead of update.
2007-07-17 23:33:42 +02:00
Patrick Mezard
3979bd753f
posixfile_nt: '+' was understood as read mode instead of update.
2007-07-17 23:33:42 +02:00
Bryan O'Sullivan
6c741e45c0
patch.py: re-add the ability to use an external patch program
...
This is now invoked by default only if ui.patch is set. Otherwise, we
use our built-in patch. If that fails because it can't find any valid
hunks, we'll fall back to trying the external patch command.
2007-07-17 09:39:30 -07:00
Bryan O'Sullivan
78c5b7bde0
patch.py: don't mark files as changed unless they have actually been changed
2007-07-17 09:39:30 -07:00
Bryan O'Sullivan
691d74d7d4
patch.py: fix some incorrect uses of _() for i18n
2007-07-17 09:39:30 -07:00
Bryan O'Sullivan
590b9213d3
Add Chris Mason's mpatch library.
...
The original repo is http://oss.oracle.com/mercurial/mason/mpatch
2007-07-17 09:39:30 -07:00
Alexis S. L. Carvalho
ae58d97874
merge with crew-stable
2007-07-17 09:28:01 -03:00
Alexis S. L. Carvalho
4770c831b2
hg parents: don't pass an OS-specific path to repo.filectx
...
The only reason to use the matcher code instead of calling util.canonpath
directly is to be able to use "path:canonical/path/to/file" patterns.
2007-07-17 09:08:29 -03:00
Thomas Arendsen Hein
26fba570c8
merge with main
2007-07-17 08:22:43 +02:00
Bryan O'Sullivan
c824069322
tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
...
This also fixes an asymmetry bug in which we called the pretag hook if we
were going to create a local tag, but didn't call the tag hook afterwards.
2007-07-16 20:15:03 -07:00
Bryan O'Sullivan
39c3672fd0
tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
...
This also fixes an asymmetry bug in which we called the pretag hook if we
were going to create a local tag, but didn't call the tag hook afterwards.
2007-07-16 20:15:03 -07:00
Bryan O'Sullivan
e2e04c39f7
issue 622: pull/unbundle -u updates to default branch if repo was empty
2007-07-16 18:01:20 -07:00
Bryan O'Sullivan
ef448328f7
issue 622: pull/unbundle -u updates to default branch if repo was empty
2007-07-16 18:01:20 -07:00
Matt Mackall
642976187f
contexts: improve filectx eq test
2007-07-16 17:39:03 -05:00
Matt Mackall
90ef8d6105
Merge with -stable
2007-07-16 17:30:34 -05:00
Matt Mackall
1e9e9e4cdd
merge: fix unnecessary rename merges on linear update (issue631)
...
If one side's revision is identical to the ancestor, we skip the rest
of the copy detection logic.
2007-07-15 14:43:38 -05:00
Matt Mackall
86ab3ea033
Merge with -stable
2007-07-14 13:34:40 -05:00
Matt Mackall
6a7cb8cbaa
diff: correctly handle combinations of whitespace options
2007-07-14 12:44:47 -05:00
Jesse Glick
5b3c852e55
typo fix
2007-07-12 10:55:49 -04:00
Brendan Cully
d4bd9b2ed8
replace .hgtags instead of appending to it when doing a raw commit
2007-07-11 00:53:44 -07:00
Brendan Cully
cd14b55f6f
handle nonexistent .hgtags in raw _tag
2007-07-11 00:34:35 -07:00
Brendan Cully
5c862af489
archive: abort on empty repository. Fixes #624 .
2007-07-10 10:06:24 -07:00
Giorgos Keramidas
827573f6ad
hg grep: handle re.compile errors & update tests/test-grep
2007-07-09 17:41:14 +03:00
Alexis S. L. Carvalho
e4f786c463
archive: make the %r escape work.
2007-07-11 19:56:16 -03:00
Alexis S. L. Carvalho
3b07689b6a
serve: respect settings from .hg/hgrc
...
create_server was looking only at the root ui object, ignoring any
settings from .hg/hgrc. To keep respecting command-line arguments,
commands.serve must also call repo.ui.setconfig.
2007-07-11 19:56:16 -03:00
Christian Ebert
7a47878736
Use isinstance instead of type == type
2007-07-06 12:02:43 +02:00
Wesley J. Landaker
49f06e37cf
Use wsgi.url_scheme instead of ad-hoc CGI checks.
...
Instead of each place in hgweb_mod that needs to check for SSL or get
the protocol scheme (http vs. https) doing it ad-hoc, make them just
look at the wsgi.url_scheme which because of previous patches is now
always set correctly.
2007-07-12 22:55:44 -07:00
Brendan Cully
a0b3ae0fbb
cosmetics
2007-07-12 22:44:16 -07:00
Wesley J. Landaker
90ae651c49
Make hg serve set the wsgi.url_scheme property correctly.
...
This fixes the bug where hg serve with SSL will always detect the wrong
urlbase for templates. This is also part of unifying the CGI interface
and hg serve interface to both use standard wsgi.
2007-07-12 13:58:36 -06:00
Wesley J. Landaker
feb6c32251
Handle CGI SSL detection via HTTPS environment better.
...
Some servers send on/off, 0/1, yes/no, and may be upper or lower case.
This fix will handle all of those permutations. It was inspired by the
detection done in in some other wsgi python web applications I looked at.
2007-07-12 13:55:20 -06:00
Alexis S. L. Carvalho
05dd580e30
merge with crew-stable
2007-07-11 20:15:03 -03:00
Wesley J. Landaker
034dcaed92
Make {urlbase} work in templates when https is used.
2007-07-10 10:54:54 -06:00
Brendan Cully
cd69031532
replace .hgtags instead of appending to it when doing a raw commit
2007-07-11 00:53:44 -07:00
Brendan Cully
c685e57a99
handle nonexistent .hgtags in raw _tag
2007-07-11 00:34:35 -07:00
Brendan Cully
7530fee196
Export extra in _tag so convert can set the branch of a tag
2007-07-11 00:04:15 -07:00
Brendan Cully
5421e55633
archive: abort on empty repository. Fixes #624 .
2007-07-10 10:06:24 -07:00
Brendan Cully
4654693aa4
Add SSL support to hg serve, activated via --certificate option
2007-07-09 22:12:28 -07:00
Thomas Arendsen Hein
5a9970a155
Add --line-number option to hg annotate (issue506)
...
Line numbers are separated from the last annotation element with a colon,
like with many other commands, e.g. (hg) grep or compiler errors.
Idea and tests by FUJIWARA Katsunori.
2007-07-08 19:59:02 +02:00
FUJIWARA Katsunori
03774e057f
Allow filectx.annotate to return the line number of first appearance.
2007-07-08 19:46:04 +02:00
Thomas Arendsen Hein
a5d49326c9
merge with crew-stable
2007-07-08 12:59:58 +02:00
Thomas Arendsen Hein
898f48cc24
hg log: Move filtering implicit parents to own method and use it in templater.
...
Extended test repo in test-command-template to contain changeset to test this.
2007-07-08 12:52:08 +02:00
Thomas Arendsen Hein
a0ef6536ad
Strip whitespace from changeset description in changeset_templater.
...
changeset_printer already does this, too.
2007-07-08 10:43:57 +02:00
Thomas Arendsen Hein
d486a44410
Removed deprecated hg:// and old-http:// protocols (issue406)
2007-07-08 09:54:42 +02:00
Brendan Cully
d2d845d908
hgwebdir: check for repo foo before browsing subdirectories of foo/
2007-07-07 21:55:56 -07:00