Commit Graph

191 Commits

Author SHA1 Message Date
Peter Arrenbrecht
a2d3e23eef cleanup: drop variables for unused return values
They are unnecessary. I did leave them in localrepo.py where there is
something like:

  _junk = foo()
  _junk = None

to free memory early. I don't know if just `foo()` will free the return
value as early.
2009-03-23 13:13:02 +01: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
Patrick Mezard
6f86a4092b context: enforce memctx.files() unicity
localrepo.commitctx() expects changed files lists to contain unique items and
does not sort itself. Passing duplicates makes them evaluated more than once
and changes the committed changelog id.
2008-12-14 17:35:19 +01:00
Dirkjan Ochtman
d5bf581a69 context: use descriptors to speed up lazy attributes 2008-11-14 12:44:26 +01:00
Dirkjan Ochtman
c8e4c03aa9 context: special-case changectx setup for integer changeid 2008-11-13 21:09:51 +01:00
Matt Mackall
b2807810c6 linkrev: take a revision number rather than a hash 2008-11-12 15:19:14 -06:00
Patrick Mezard
ad3b5c4ec9 context: improve memctx documentation 2008-10-11 13:07:29 +02:00
Peter Ruibal
30a2036f9e use Exception(args)-style raising consistently (py3k compatibility) 2008-09-08 13:07:00 +02:00
Matt Mackall
08b29d9875 Merge with stable
Simplify the copy search algorithm
2008-08-10 18:38:43 -05:00
Dirkjan Ochtman
26b9b92409 context: get rid of unused changectx.filectxs() method 2008-07-21 13:26:42 +02:00
Dirkjan Ochtman
6b15d82e07 context: fix workingctx's __contains__ method 2008-07-21 13:22:11 +02:00
Matt Mackall
e008b3db94 dirstate.walk: build a dict rather than yield
Since we're already building a seen dict, we might as well put our
results in it to go slightly faster.
2008-07-22 13:03:21 -05:00
Matt Mackall
8cb2b4a288 dirstate.walk: push sorting up 2008-07-22 13:03:19 -05:00
Matt Mackall
9d3da8e0ee dirstate.walk: eliminate src from yield
- restructure 'step two' to stat unseen files
- remove extra stat logic in status
- remove redundant src
2008-07-22 13:02:36 -05:00
Matt Mackall
b4ff221e3e minor status fixups 2008-07-22 13:00:22 -05:00
Patrick Mezard
c2be161a5c context: trigger missing username warning only when necessary 2008-07-20 19:09:00 +02:00
Matt Mackall
b161cadfc8 context: simplify parents code 2008-07-11 18:46:02 -05:00
Matt Mackall
644a7f906e workingctx: add __contains__ method 2008-07-11 18:46:02 -05:00
Matt Mackall
f1402a6652 context: add walk method 2008-06-27 19:25:48 -05:00
Matt Mackall
087987c8d8 context: add __int__ and hex methods 2008-06-27 18:44:43 -05:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
d4ab55a92b status: clean up all users for unknown files 2008-06-27 13:43:29 -05:00
Matt Mackall
fbb5127472 use repo[changeid] to get a changectx 2008-06-26 14:35:46 -05:00
Matt Mackall
25b1f97147 context: remove islink and isexec methods 2008-06-26 13:52:16 -05:00
Matt Mackall
d462e1fc26 simplify flag handling
add _checklink var to dirstate
introduce dirstate.flagfunc
switch users of util.execfunc/linkfunc to flagfunc
change manifestdict.set to take a flags string
change ctx.fileflags to ctx.flags
change gitmode func to a dict
remove util.execfunc/linkfunc
2008-06-26 13:46:34 -05:00
Matt Mackall
2bd0fe0371 context: clean up parents() 2008-06-26 13:46:33 -05:00
Matt Mackall
2d2ae68ba8 context: simplify changeid logic 2008-06-26 13:46:31 -05:00
Matt Mackall
0a211cf39a context: consistently return p1 context for None 2008-06-25 17:33:51 -05:00
Dirkjan Ochtman
b5da46f6f1 kill some trailing spaces 2008-06-23 13:12:32 +02:00
Christian Ebert
11232ed4ba Fix commit date (issue1193)
The None check in workingctx prevents calling util.makedate
when date is not explicitly given.
2008-06-21 15:27:51 +02:00
Patrick Mezard
1ae4077ddd context: add memctx for memory commits 2008-06-19 00:14:23 +02:00
Patrick Mezard
67c45a2700 context: let workingctx.date(), .user() and description() be overriden 2008-06-18 22:52:26 +02:00
Patrick Mezard
767445bf63 localrepo: let commit() get extra data from workingctx 2008-06-18 22:52:26 +02:00
Patrick Mezard
f2fb1d0609 localrepo: hide commit() file selection behind workingctx 2008-06-18 22:52:25 +02:00
Patrick Mezard
d184e29b1c context: let workingctx parents be overriden 2008-06-18 22:52:25 +02:00
Patrick Mezard
1fa87a95fd Merge with crew-stable 2008-06-15 13:05:39 +02:00
Patrick Mezard
af038bed31 context: fix workingctx.fileflags() execute bit 2008-06-15 13:01:01 +02:00
Patrick Mezard
91d2df2c77 Merge with crew-stable 2008-04-12 21:34:01 +02:00
Patrick Mezard
3409e6fdc3 context: handle untracked files in filectx.fileflags() 2008-04-12 21:08:03 +02:00
Paul Moore
0046a32c4b python 2.6 compatibility: add __hash__ to classes that have __eq__ 2008-04-04 22:41:17 +02:00
Alexis S. L. Carvalho
dd492604df filectx.ancestor: use fctx._repopath to cache filelogs (issue1035)
_repopath may be different from _path for workingfilectx when there
are renames involved.
2008-03-16 06:10:47 -03:00
Matt Mackall
865487e7f2 revlog: report node and file when lookup fails 2008-03-11 17:42:29 -05:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Thomas Arendsen Hein
deb94bc7fe Removed trailing spaces from everything except test output 2008-03-07 00:24:36 +01:00
Patrick Mezard
4b9a547de4 context: fix filectx.parents() bug introduced when editing 3fb82bcfc6e3 2008-01-06 15:40:32 +01:00
Maxim Dounin
4d9877b4eb Fix copies reporting in log and convert.
If copy logged in file revision, we report copy for changeset only
if file revisions linkrev points back to the changeset in question
or both changeset parents contain different file revisions.

This fixes extra copies reported when executable bit was changed for
previously copied file.
2007-12-29 17:11:48 +03:00
Maxim Dounin
940a0afd31 context: preserve changeset in filectx if we have one
If we know original changeset we are working with - try hard to
preserve it. Fallback to filelog.linkrev() only if we have no way
to get original changeset, since linkrev() may point to other
changeset.
2007-12-29 16:57:43 +03:00
Thomas Arendsen Hein
347da85c36 Removed tabs and trailing whitespace in python files 2007-12-29 19:49:48 +01:00
Bryan O'Sullivan
d32d6fb57f make LookupError more detailed 2007-11-28 08:36:55 -08:00
Bryan O'Sullivan
2a0ef5ab06 Fix context iterator. 2007-11-02 14:44:33 -07:00
Bryan O'Sullivan
6df62fb77c convert: make contents of "extra" dict available from sources, for sinks.
This breaks hash preservation for hg->hg conversion, as each converted
change gets a convert_revision item added to its extra dict.  Ugh.
2007-10-10 15:30:00 -07:00
Patrick Mezard
2dee2a1086 Fix workingctx exec/link bit of copies on non-supporting systems 2007-10-07 15:07:35 +02:00
Patrick Mezard
8102777e5e Fix bad lambda prototype in workingctx.fileflags() 2007-10-06 17:54:33 +02:00
Patrick Mezard
904ffeda9f context: add fileflags() to avoid rebuilding manifests 2007-10-05 23:01:38 +02:00
Matt Mackall
410e8d67c6 context: add __contains__, __getitem__, and __iter__ 2007-07-21 16:02:09 -05:00
Matt Mackall
642976187f contexts: improve filectx eq test 2007-07-16 17:39:03 -05:00
FUJIWARA Katsunori
03774e057f Allow filectx.annotate to return the line number of first appearance. 2007-07-08 19:46:04 +02:00
Matt Mackall
cfe7a0a522 merge: make test for fast-forward merge stricter (issue619)
don't allow merging with an ancestor
fix != on contexts
add a test
2007-07-05 13:34:18 -05:00
Matt Mackall
7be33e5057 context: add tags() method 2007-06-21 11:42:39 -05:00
Patrick Mezard
0b90ff3d83 Merge with crew-stable 2007-06-20 00:22:51 +02:00
Patrick Mezard
aae84719a5 Fix issue 589: "undelete" sequence leads to crash. 2007-06-20 00:10:21 +02:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Matt Mackall
5fa7270b2d Merge with stable 2007-05-08 11:42:48 -05:00
Matt Mackall
d4deb74aa1 context: fix workingfilectx._changectx 2007-05-07 22:30:36 -05:00
Matt Mackall
e896adead6 Merge with -stable, fix small test failure 2007-03-14 01:26:09 -05:00
Matt Mackall
c2bb73121f Move branch read/write to dirstate where it belongs 2007-03-13 18:50:02 -05:00
Matt Mackall
19d825d10e Minor default branch cleanups 2007-03-13 15:47:55 -05:00
Alexis S. L. Carvalho
fd69fe8d91 "default" is the default branch name 2007-03-13 15:02:33 -03:00
Thomas Arendsen Hein
d104165f50 Use only integer part of mtime in workingfilectx.date(), fixes test-context.py
Similar to what is done in dirstate.status() (changeset db96436edaee)
and has to be removed when Mercurial switches to subsecond granularity.
2007-02-26 21:57:33 +01:00
Thomas Arendsen Hein
c20f16ea94 Fixed workingfilectx.date() (found by Thomas Waldmann) with test. 2007-02-23 17:31:00 +01:00
Matt Mackall
2e27ddd82b symlinks: use is_link wherever is_exec is used 2006-12-29 20:04:31 -06:00
Matt Mackall
b875ad6c04 exec: add execfunc to simplify exec flag support on non-exec filesystems 2006-12-29 20:04:30 -06:00
Benoit Boissinot
35f1d19852 context: create a filectxt with filelog reuse 2006-12-25 18:57:55 +01:00
Benoit Boissinot
a8be9617b4 context: fix a bug in workingfilectx.renamed 2006-12-25 17:43:47 +01:00
Benoit Boissinot
6b47271f10 make it possible to use changectx to create a filectx 2006-12-25 17:43:44 +01:00
Benoit Boissinot
36bf020419 add date attribute to workingfilectx 2006-12-24 22:55:34 +01:00
Benoit Boissinot
6c61f6a933 fix tab vs space 2006-12-24 22:29:29 +01:00
Brendan Cully
8a6eea2483 Add revlog.LookupError exception, and use it instead of RevlogError.
Remove repo.LookupError, which devolves to the revlog version.
2006-12-18 12:22:43 -08:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Matt Mackall
6148417831 context: don't spuriously raise abort when a file goes missing. 2006-12-08 13:14:57 -06:00
Brendan Cully
261404dfe1 Make context __eq__ handle arbitrary RHS values 2006-11-27 15:27:09 -08:00
Benoit Boissinot
97597496aa context: None is not a valid filenode (revert from ae31fe77b54b) 2006-11-27 20:55:50 +01:00
Thomas Arendsen Hein
411d64ce3e white space and line break cleanups 2006-11-17 08:06:54 +01:00
Thomas Arendsen Hein
687e4a7111 Define and use nullrev (revision of nullid) instead of -1. 2006-10-29 10:53:51 +01:00
Matt Mackall
e8cb00b8c7 filecontext: report False for missing files 2006-10-18 14:06:48 -05:00
Matt Mackall
bd3a8da1a7 Merge with crew 2006-10-17 18:54:37 -05:00
Matt Mackall
506e5e54f6 Add branch method to contexts 2006-10-17 18:30:12 -05:00
Brendan Cully
7761a89cfe Fix annotate where linkrev != rev without exporting linkrev 2006-10-15 18:43:46 -07:00
Brendan Cully
63d34eb36b Back out da2c890e2644 and 278eadc04b61 2006-10-15 18:25:07 -07:00
Brendan Cully
bcf56af444 Add linkrev to filectx 2006-10-15 17:37:04 -07:00
Matt Mackall
e5ce68c388 Merge with crew 2006-10-11 17:37:48 -05:00
Brendan Cully
fb4e783895 changectx: search manifest delta for filenode 2006-10-11 13:56:35 -07:00
Brendan Cully
a3547ef308 context: check self.__dict__ instead of using hasattr
hasattr implicitly calls getattr, instantiating the field it is
checking for.
2006-10-11 13:34:12 -07:00
Giorgos Keramidas
b10311c5e9 Revert changeset d48690da3368.
It breaks 'hg merge && hg up -c REV' when files exist only in one of the
manifests, making hg throw a traceback like:
2006-10-10 21:03:24 +03:00
Matt Mackall
208002d0f3 context: change workingctx str() from . to <node>+ 2006-10-10 02:11:59 -05:00
Matt Mackall
87112abb50 context: add cmp for filectxs 2006-10-10 01:13:03 -05:00
Matt Mackall
7ac4f59673 filectx: add size method 2006-10-09 23:20:48 -05:00
Matt Mackall
12c8fcfa84 fix workingfilectx parents and ancestor functions 2006-10-09 21:04:25 -05:00