Commit Graph

191 Commits

Author SHA1 Message Date
Peter Arrenbrecht
3ecec5f671 context: allow passing the common cset ancestor to fctx.ancestor
This is used by the next patch to speed up merge.applyupdates.
2010-06-18 08:48:05 +02:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Alexander Solovyov
558ccfdb04 slightly improve memctx api 2010-05-01 15:00:21 +03:00
Benoit Boissinot
a627942638 merge with stable 2010-05-11 20:21:25 +02:00
Benoit Boissinot
80751fb4aa context: fallback function should not return None 2010-05-11 20:13:52 +02:00
Edouard Gomez
079690a146 subrepo: dirtiness checks should iterate over subrepos 2010-05-01 23:05:21 +02:00
Steve Borho
f15661a778 changectx: change diff() to accept keyword opts 2010-05-07 14:07:30 -05:00
Steve Borho
68abae61b6 changectx: use repo.ui diffopts, allow argument override 2010-05-07 10:59:11 -05:00
Matt Mackall
ad8006c15f context: only scan unknowns when needed 2010-05-05 20:21:57 -05:00
Matt Mackall
cb35f80674 context: use asserts for ignored and clean exceptions 2010-05-04 15:52:42 -05:00
Steve Borho
c9196798ff workingctx: use member variables to store ignored and clean
If some code tries to query ignored or clean files without first
calling the explicit status() method to query them, it will raise
an exception (indicating a software bug).
2010-05-04 15:02:55 -05:00
Steve Borho
ab2c41068e workingctx: add explicit status method, add ignored and fix clean
workingctx.clean() and memctx.clean() have both been returning ignored files
since their creation.  This patch fixes clean() while introducing a method for
querying ignored files.  The new status() method can be used to explicitly
override the default (fast) arguments used by the _status property.
2010-05-04 14:52:25 -05:00
Steve Borho
d1f3ff6382 context: add a changectx.diff() convenience function
With this function, extracting diffs becomes trivial:

repo = hg.repository(ui.ui(), path=root)
ctx = repo['tip']
for out in ctx.diff():  print out
2010-05-04 20:12:58 -05:00
Benoit Boissinot
a6309b7596 context: remove parents parameter to workingctx
it was needed before the refactor of commit, workingctx always uses the
dirstate now.
2010-04-21 01:18:31 +02:00
Benoit Boissinot
6fa67d00f9 filectx: _fileid isn't normalized, use _filenode instead
_fileid can be anything the lookup accepts (hex(node), node, rev, etc.), we
should use something stable for comparisons (like _filenode).
2010-04-19 20:30:31 +02:00
Benoit Boissinot
788c113d09 context: fix bug introduced in f2d764a0939e, path should be used 2010-04-16 01:57:32 +02:00
Benoit Boissinot
73bdc48646 workingctx: correctly compute the flag for noexec filesystems+merge
This bug happens if the filesystem doesn't support exec-bit, during merges,
for example in 0b01431fee25 on the hg repo.
If f is not in p1, but is in p2 and has the x-bit in p2, since the dirstate is
based on p1, and the FS doesn't support the exec-bit, the dirstate can't
"guess" the right bit.
We instead fix it in workingcontext.flags()/manifest.
2010-04-15 18:08:48 +02:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Matt Mackall
525da95fd6 copies: speed up copy detection
On some large repos, copy detection could spend > 10min using
fctx.ancestor() to determine if file revisions were actually related.
Because ancestor must traverse history to the root to determine the
GCA, it was doing a lot more work than necessary. With this
replacement, same status -r a:b takes ~3 seconds.
2010-01-19 22:20:05 -06:00
Matt Mackall
948fcf8eac merge: fix changectx.ancestor(workingctx) (issue1327) 2009-11-12 12:03:39 -06:00
Matt Mackall
010544e3e6 filectx: shortcut unrelated files in ancestor() (issue1327) 2009-11-07 14:07:45 -06:00
Matt Mackall
d1a9a67d84 merge: first part of fix for issue1327
When there are no renames involved, we shortcut to the changeset
ancestor. This resolves most cases.

Note that Mercurial's rename philosophy elsewhere is that a file's
name is signficant and rename data is only consulted when a file of
the same name is absent.
2009-11-07 14:07:45 -06:00
Greg Ward
889a9ffb8d cmdutil: changeset_printer: use methods of filectx/changectx.
This allows extensions that modify changeset metadata (e.g.
description) by overriding methods of changectx to get consistent
behavior from all log-like commands, regardless of whether templates
or styles are used. Without this, overriding changectx methods works
if you use styles or templates, but not with default log format.

This meant adding filectx.extra() for consistency with changectx.
2009-10-05 18:17:13 -04:00
Nicolas Dumazet
7eadbe8d42 for calls expecting bool args, pass bool instead of int
str.splitlines and email.message.as_string both expect a bool argument
defaulting at False: replace f(1) by f(True) and f(0) by f()
2009-07-13 09:50:26 +09:00
Matt Mackall
eb6cba34d7 Merge with stable 2009-07-09 19:49:02 -05:00
Matt Mackall
f5635aa406 filectx: add a hex method 2009-07-06 14:52:44 -05:00
Matt Mackall
e3dc8aa6db fix memory usage of revlog caches by limiting cache size [issue1639] 2009-07-09 17:10:07 -05:00
Greg Ward
acf5297c3a context: improve arg-checking assert. 2009-07-03 10:43:46 -04:00
Matt Mackall
fd08adf4d6 commit: recurse into subrepositories 2009-06-15 02:45:38 -05:00
Matt Mackall
ce2e49a0da subrepo: introduce basic state parsing 2009-06-15 02:45:38 -05:00
Matt Mackall
56c9dee4e1 context: add a dirty method to detect modified contexts 2009-06-04 16:21:55 -05:00
Augie Fackler
678623416a dirstate: don't check state of subrepo directories 2009-12-31 17:19:30 -06:00
Benoit Boissinot
0c85bdcee0 context: parents() already filters nullid 2009-12-01 01:08:16 +01:00
Benoit Boissinot
e4e6f5d929 context: use key-sorting instead of tuples 2009-12-01 01:03:54 +01: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
Matt Mackall
188df2eaa9 context: add new manifestnode method 2009-05-14 13:21:20 -05:00
Matt Mackall
9a5dcd2974 context: add p1 and p2 methods 2009-05-14 13:20:40 -05:00
Matt Mackall
49e6e0b6c0 filecommit: swallow some bits from _commitctx, add _ 2009-05-14 13:20:40 -05:00
Simon Heimberg
df774ad0e5 context: replace pseudo-set by real set 2009-05-14 10:59:55 +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
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Matt Mackall
9ec97bdefe util: take propertycache from context.py 2009-04-26 16:50:44 -05:00
Martin Geisler
3ce0ca846d context: use Python 2.4 decorator syntax 2009-04-24 18:47:15 +02:00
Martin Geisler
44aa7e92d1 util: use built-in set instead of util.unique 2009-04-22 00:56:06 +02:00
Patrick Mezard
cd3505dbbc Merge with crew-stable 2009-04-13 21:57:17 +02:00
Patrick Mezard
4764779700 context: fix workingctx.__contains__ 2009-04-13 19:47:11 +02:00