Commit Graph

4837 Commits

Author SHA1 Message Date
Patrick Mezard
f8fb6f0d87 ui: honor interactive=off even if isatty() 2009-05-21 20:59:36 +02:00
Patrick Mezard
89b691f7f6 Merge with crew-stable 2009-05-21 22:41:18 +02:00
Patrick Mezard
1e0e3ba6d6 hgwebdir: fix [collections] evaluation under Windows
Virtual and real path separators are not the same under Windows.
2009-05-21 20:32:45 +02:00
Martin Geisler
6355b4950b cmdutil: mark string for translation 2009-05-20 12:20:27 +02:00
Martin Geisler
5b0900d7be util: use "is" for True/False/None comparisons 2009-05-20 10:50:23 +02:00
Benoit Boissinot
58c694795e remove: warn if unversionned files are specified (issue1454) 2009-05-20 21:16:04 +02:00
Benoit Boissinot
5b1d4a56ec filelog encoding: move the encoding/decoding into store
the escaping of directories ending with .i or .d doesn't
really belong to filelog.

we put the encoding/decoding in store instead, for backwards
compat, streamclone and the fncache file format still uses the
partially encoded filenames.
2009-05-20 18:35:47 +02:00
Benoit Boissinot
ee58830640 store: refactor the fncache handling
put all the fncache file writing and reading in
the same place.
2009-05-20 18:35:41 +02:00
Jeremy Whitlock
c090150d2d hgweb: make hgwebdir handle dict/list paths the same as config paths
Before this patch, the only way to get hgwebdir to honor the recursive paths
was to create a config object or a config file with the recursive paths in it.
This patch makes hgwebdir treat paths the same whether passed in as a list,
tuple, config or however hgwebdir supports passing paths.
2009-05-20 16:04:37 +02:00
Benoit Boissinot
37cf6c6d68 workingfilectx: always use the same filelog, even for renames
workingfilectx() was using the "src" filelog in case the file was renamed in
the working copy.
For consistency, stop special-casing it. This allows us to remove some
duplication between filectx and workingfilectx.
2009-05-20 02:08:53 +02:00
Martin Geisler
0a365d5ca2 use 'x is None' instead of 'x == None'
The built-in None object is a singleton and it is therefore safe to
compare memory addresses with is. It is also faster, how much depends
on the object being compared. For a simple type like str I get:

            | s = "foo" | s = None
  ----------+-----------+----------
  s == None | 0.25 usec | 0.21 usec
  s is None | 0.17 usec | 0.17 usec
2009-05-20 00:52:46 +02:00
Martin Geisler
d4730b32a3 patch: simplify Boolean expression slightly
The context variable is either True, False or None. Abbreviate it as C
and we get the following truth table where the second column is the
original expression and the third column is the new expression:

  C     | C or C == None | C is not False
  True  | True           | True
  False | False          | False
  None  | True           | True
2009-05-20 00:43:23 +02:00
Martin Geisler
fc8a97dac3 changelog: refuse to add revisions with empty usernames
An empty username or a username with a "\n" will make the revision
text contain two "\n\n" sequences -> corrupt repository.

The problem is that changelog.read expects to find exactly one "\n\n"
separator and thus cannot unpack the revision.
2009-05-16 11:12:49 +02:00
Martin Geisler
aed75cf65f util: import random, missing since 5c703a28d882 2009-05-14 22:59:12 +02:00
Simon Heimberg
1b0d5c18bb match: use self.exact instead of lambda
self.exact uses a set and does not need an extra copy of the files
2009-05-15 09:43:30 +02:00
Simon Heimberg
23a0184faf dirstate: use quicker matchfn() instead of match() everywhere
matchfn does the same as match(), but a direct "link"
2009-05-14 19:47:52 +02:00
Benoit Boissinot
fc43ae9519 update --clean: do not unlink added files (issue575) 2009-05-19 03:59:58 +02:00
Martin Geisler
e651951731 templater: lowercase error message
Changing this messages should be safe: automated scripts ought to have
debugged their templates and wont grep for this error message.
2009-05-17 16:25:48 +02:00
Simon Heimberg
e859b5a899 util: use set instead of dict 2009-05-19 09:57:06 +02:00
Benoit Boissinot
32cfb07e37 localrepo: update commit*() docstrings 2009-05-19 11:39:12 +02:00
Matt Mackall
2c76d48a96 commit: tidy up mergestate slightly 2009-05-18 17:36:24 -05:00
Matt Mackall
74e80399a4 commit: drop unneeded dirstate invalidate logic
We no longer touch the dirstate in the middle of a commit, so a
failing commit doesn't require invalidating the dirstate.
2009-05-18 17:36:24 -05:00
Matt Mackall
4a8855a861 commit: some tidying
- simplify handling of 'close'
- kill silly wlock=None
- sort/uniq files later
2009-05-18 17:36:24 -05:00
Matt Mackall
7e42b4325d commit: remove unused lock var 2009-05-18 17:36:24 -05:00
Matt Mackall
98aa07c578 commit: move description trimming into changelog 2009-05-18 17:36:24 -05:00
Matt Mackall
6489ae039f commit: simplify manifest commit 2009-05-18 17:36:24 -05:00
Matt Mackall
16d4ef56bc commit: explain how to abort commit in editor 2009-05-18 17:36:24 -05:00
Matt Mackall
89cb6de980 commit: move editor outside transaction
The commit editor is now invoked before files and manifest are
committed. The editor is now run with only the wlock held and aborting
an edit no longer requires rolling back a transaction. Changes to
files during a commit still result in undefined behavior.

(This is preliminary work for committing subrepositories)
2009-05-18 17:36:24 -05:00
Matt Mackall
cfe14089d0 templater: replace eval with closure 2009-05-17 18:17:04 -05:00
Benoit Boissinot
bee6cb3d55 addremove/findrenames: find renames according to the match object (issue1527)
Instead of only finding similarities in the added/removed files found
by the addremove step, follow the match object:

hg addremove -s80 foo -> add and removes files in foo
                         + find similarities between files in foo
hg addremove -s80 -> add and removes files in the whole repo
                     + find similarities between files in the whole repo

hg import --similarity will still work correctly (only find similarities
between files found in the patch).
2009-05-17 22:51:17 +02:00
Benoit Boissinot
6f0577d081 addremove: mapping isn't really needed, simplify 2009-05-17 22:40:04 +02:00
Martin Geisler
1dfd32f41d hbisect: use set.update for bulk updates 2009-05-17 16:57:12 +02:00
Martin Geisler
6668b0e4a5 localrepo: use set.update for bulk updates 2009-05-17 16:56:53 +02:00
Martin Geisler
f7fa8ce35f store: create set directly from iterable 2009-05-17 16:56:20 +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
Martin Geisler
698fece124 ui: use set instead of dict 2009-05-17 16:20:27 +02:00
Dirkjan Ochtman
140e5350fc templater: keep a cache of Python functions for filter expressions 2009-05-17 16:08:47 +02:00
Dirkjan Ochtman
56f023f70e templater: replace regex complexity by simple str containment checks 2009-05-17 16:06:48 +02:00
Dirkjan Ochtman
f421494a6a templater: clean up the process method, separating code paths 2009-05-17 16:05:50 +02:00
Benoit Boissinot
491d11faff localrepo: use set instead of dict 2009-05-17 04:33:39 +02:00
Benoit Boissinot
b23ce9123e copies: use set instead of dict 2009-05-17 04:20:59 +02:00
Benoit Boissinot
3f0d683495 store: use set instead of dict 2009-05-17 04:16:44 +02:00
Benoit Boissinot
f23fc93dd5 verify: use set instead of dict 2009-05-17 04:14:15 +02:00
Benoit Boissinot
1f59ef6f81 ancestor: use set instead of dict 2009-05-17 03:53:13 +02:00
Benoit Boissinot
c97e6590bb revlog: use set instead of dict 2009-05-17 03:49:59 +02:00
Benoit Boissinot
dbf61e11b8 bisect: use set instead of dict 2009-05-17 03:40:54 +02:00
Benoit Boissinot
21c663ad08 repair: use set instead of dict 2009-05-17 03:38:03 +02:00
Benoit Boissinot
a59b10003e patch: use set instead of dict 2009-05-17 03:28:49 +02:00
Benoit Boissinot
c8bc34d692 revlog.missing(): use sets instead of a dict 2009-05-17 02:44:12 +02:00
Martin Geisler
b43ec973e1 changelog: turn {de,en}code_extra methods into functions
The methods were not really methods -- they didn't use 'self'. Having
them as functions in the module it useful for other modules (like the
commitsigs extension) that want to recompute the changeset hash and
thus want to encode dicts the same way as changelog does it.

Removed the underbars from their names at the same time.
2009-05-15 01:21:24 +02:00