Commit Graph

45 Commits

Author SHA1 Message Date
Sean Farley
8a2b735de6 svnmeta: move revmap.oldest to meta.firstpulled
We factor out revmap.oldest and rename it to 'firstpulled' to make it analogous
with 'lastpulled'.
2014-03-24 11:20:45 -05:00
Sean Farley
6a6a200bb6 svnmeta: move revmap.youngest to meta.lastpulled
Using our new generator, we factor out revmap.youngest and renamed it to the
same name as the config file 'lastpulled' because that is the name of the file
and is arguably less confusing to read.
2014-03-24 11:20:44 -05:00
Sean Farley
33a9a0d959 maps: change revmap init to accept svnmeta not a repo
This will allow us to access config options through one object.
2014-03-24 11:20:44 -05:00
Sean Farley
1351223c88 maps: change readmapfile to take a path instead of repo
This is a small refactor for an upcoming change that will change map objects to
store a svnmeta instead of the repo.
2014-03-24 11:20:44 -05:00
Sean Farley
018df91880 maps: call util.dump instead save_string
Now that we're using json, we can use one centralized way of serializing data.
2014-02-15 10:54:08 -06:00
Sean Farley
817bb83146 util: remove all calls to load_string
Now that we use json, we no longer need to load strings differently from any
other serialized data.
2014-02-15 10:45:51 -06:00
maugustin
0e3dd689bd authormap: allow case-insensitive authormaps for easier conversions 2013-01-08 10:44:38 +01:00
Dan Villiom Podlaski Christiansen
f6057dd24b maps: only show 'reading ...' as debug output
I find it a bit too chatty for verbose output...
2012-11-11 15:30:49 +01:00
Patrick Mezard
9cd312417e maps: fix filemap loading --verbose message
The m.stri('e') was removing the leading 'e' or 'exclude'.
2012-10-14 13:21:03 +02:00
Dan Villiom Podlaski Christiansen
07163c424f kill all 'print' statements in the extension proper 2012-05-12 15:41:21 +02:00
Bryan O'Sullivan
30ef9363dc revsets: huge speedups for fromsvn and svnrev
I have a hgsubversion repo that contains over 300,000 commits.

In that repo, this patch improves performance as follows:

hg --time log -r 'first(fromsvn())'
Before: 40.3 sec
After:   0.8 sec

hg --time log -r 'svnrev(350000)'
Before: 40.3 sec
After:   0.1 sec

Note: the performance of these revset implementations is very sensitive
to doing as little work as possible per line of the rev_map file.
I originally attempted to hide the file format details by hoisting the
parsing of each line up into RevMap.readmapfile, but the current less
abstract code is dramatically (10x or more) faster.

If the revmap file is missing, we error out and print a message
describing what to do.
2012-05-12 05:38:34 -07:00
Vitaliy Filippov
5d599503da Respect filemap rule order (rules that come first are overridden by rules that come later) 2012-01-28 02:18:25 +04:00
Vitaliy Filippov
b7d6000217 Save filemap into .hg/svn/filemap just like other maps 2012-01-20 19:06:32 +04:00
Yonggang Luo
7918e56697 revmap: load/save _youngest using new load_string and save_string API 2011-10-01 00:42:27 +08:00
Yonggang Luo
b5eb96ab08 maps: s/hash/ha/ and s/map/m/ to avoid hiding Python builtins
Also rename unused sbuf -> _sbuf.
2011-10-01 00:50:10 +08:00
Augie Fackler
bab624ab93 stupid/filemap: disable this since it doesn't currently work
hg 1.9 dramatically cleaned up patch application, but unfortunately
this breaks stupid mode with filemaps. In the name of getting a
release out the door, disabling this feature for now. There will be
changes required in hg to make this work again, so we may just drop
the feature entirely if nobody's interested.
2011-09-30 17:01:35 -05:00
Augie Fackler
e4889e1065 svnmeta: store youngest revision pulled from subversion
This prevents re-pulling the same revision over and over, which was a
problem when the most recent revision was a tagging revision that
wouldn't exist properly in the revmap. This should also allow users to
not re-pull huge volumes of commits that have no effect on the hg
repository.
2011-05-24 21:07:27 -05:00
maugustin
deec1dc090 authormap: only append new or changed authors
Previously, specifying an extra authormap with the
hgsubversion.authormap configuration variable would cause the entirety
of the other authormap to be appended to the one in '.hg/svn/authors'
on each subversion access (e.g. hg in/out/pull/push).

This also changes the authormap to preserve comments and the like in
the authormap file.
2011-07-23 19:33:50 -05:00
maugustin
7d8b787cea authormap: expand environment variables when evaluating map path 2011-07-06 07:55:14 -05:00
Augie Fackler
547d7b74af maps: clean up whitespace 2011-05-24 16:07:32 -05:00
Dan Villiom Podlaski Christiansen
a914120eaf remove redundant calls to fd.flush() prior to doing fd.close(). 2010-11-09 13:49:30 +01:00
Dan Villiom Podlaski Christiansen
2fa6c3592c maps: map a missing author to '(no author)'
"None" doesn't really make much sense, so we use what 'svn log' shows
instead. This also fixes mapping this author to something else.
2010-10-09 16:20:52 -05:00
Dirkjan Ochtman
bfc7292462 implement tag renames
This uses a separate map, since the purpose is very different from the purpose
of the TagMap that we currently have. It seemed to me that unifying both will
only serve to make the implementation more complicated. The name TagRenames
is not that elegant, but I didn't have any better idea. Feel free to change.
2010-10-08 19:07:04 +02:00
Dirkjan Ochtman
c868a8ce9c rename TagMap to Tags, to free up the TagMap name 2010-10-06 16:50:10 +02:00
Dirkjan Ochtman
c6d23ef903 fix some style nits 2010-10-06 15:18:15 +02:00
Dan Villiom Podlaski Christiansen
3ab870228b maps: rename revmap.seen to revmap.youngest; add revmap.oldest. 2010-07-20 11:55:07 +02:00
Dan Villiom Podlaski Christiansen
810c369ce1 branchmap: reject empty mappings 2010-07-10 14:48:57 +02:00
Dan Villiom Podlaski Christiansen
4ed28d7664 maps: don't set the `seen' attribute in TagMap.__init__().
This seems like something left over from copying RevMap.__init__();
the attribute does not make sense for TagMap, nor is it ever expected
to have it.
2010-06-23 11:37:03 +02:00
Augie Fackler
30e34465d8 maps: fix a % formatting bug 2010-03-27 18:42:47 -05:00
Dirkjan Ochtman
66f986fb89 maps: if operation can continue, it should probably not use ui.warn() 2010-03-01 21:26:30 +01:00
Dirkjan Ochtman
7e2d3d3d2b add basic branchmap functionality, to rename branches 2010-03-01 22:10:18 +01:00
Dirkjan Ochtman
525ead6e57 svncommands: make repo optional (useful for things like listauthors) 2010-02-23 17:16:51 +01:00
Patrick Mezard
208898e524 maps: TagMap tags are non-empty strings 2010-01-18 21:40:29 +01:00
Augie Fackler
c6bfa418c4 tagmap: missed newline in rebuildmeta warn call 2009-07-06 09:17:26 -05:00
Augie Fackler
65ebb3cfa8 rebuildmeta: remove any existing tagmap file. 2009-07-05 21:44:35 -05:00
Augie Fackler
0b5a9621bd tags: handle copyfrom old versions of tags more correctly 2009-07-01 14:42:46 -05:00
Augie Fackler
35a0874bd4 tags: reinstate a tag map file in a better way 2009-06-23 21:33:40 -05:00
Dirkjan Ochtman
c9ba1e00a4 maps: make sure AuthorMaps don't overwrite themselves, fix overriding
Author maps for the Python repo got truncated because of the author map stupidly
writing upon itself. This patch implements a better and faster scenario, where
entries will only be written to the saved author map if they're not coming from that
file. They're also now streamed into the file directly, instead of having to re-open
the file on every entry, and formatting is preserved.
2009-06-15 16:09:27 +02:00
Dirkjan Ochtman
38c737885e svnmeta: move revmap methods, make last_known_revision() more efficient 2009-06-11 10:32:32 +02:00
Dirkjan Ochtman
75d1f9d477 extract the filemap support into a separate class 2009-06-11 18:52:30 +02:00
Dirkjan Ochtman
d8027dac29 extract the revmap support into a separate dict-like class 2009-06-10 15:45:20 +02:00
Dirkjan Ochtman
a4e1b66614 Author maps: strip comments. 2009-05-28 09:44:47 +02:00
Dirkjan Ochtman
a93bb5d115 Author maps: code/message style (prevent line continuations). 2009-05-28 09:44:08 +02:00
Dirkjan Ochtman
7e0ec65639 Author maps: handle lines without = gracefully. 2009-05-28 09:41:00 +02:00
Augie Fackler
94a7ecbe68 Reorganize to have a more conventional module structure.
This means that hgsubversion now uses absolute imports instead of
relative ones, which makes the tests more reliable.
2009-05-13 21:39:39 -05:00