Mercurial > hgsubversion
annotate hgsubversion/svncommands.py @ 1434:0a6b3da6d34c
RevMap: move lastpulled from SVNMeta down into RevMap
There was a conceptual cycle present between the revmap and the meta
object caused by this layering, which is nicely resolved by moving the
lastpulled information down into the revmap.
RevMap no longer makes use of meta outside the constructor, which is
great progress.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sun, 05 Jun 2016 21:18:23 -0400 |
parents | 014c47a8e653 |
children | cbc48ed3b56c |
rev | line source |
---|---|
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
1 import os |
493
41c333473dda
try to deal with weirdly located branches in rebuildmeta (#118)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
474
diff
changeset
|
2 import posixpath |
616
532c545d162c
svncommands: add two missing imports
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
611
diff
changeset
|
3 import sys |
532c545d162c
svncommands: add two missing imports
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
611
diff
changeset
|
4 import traceback |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
5 import urlparse |
989
68191be64af8
updatemeta: fix missing errno import
Patrick Mezard <patrick@mezard.eu>
parents:
988
diff
changeset
|
6 import errno |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
7 |
598
e432b61c6d74
Use Mercurial-provided infrastructure for `svn' metacommand help.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
595
diff
changeset
|
8 from mercurial import commands |
242
06130689a2c8
Move push into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
241
diff
changeset
|
9 from mercurial import hg |
06130689a2c8
Move push into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
241
diff
changeset
|
10 from mercurial import node |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
11 from mercurial import util as hgutil |
573
00393e9abff8
svncommands: make repo optional (useful for things like listauthors)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
566
diff
changeset
|
12 from mercurial import error |
242
06130689a2c8
Move push into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
241
diff
changeset
|
13 |
1007
e95f4de8709a
layouts: refactor buildmeta layout reading and writing
David Schleimer <dschleimer@fb.com>
parents:
1002
diff
changeset
|
14 import layouts |
448
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
15 import maps |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
16 import svnwrap |
464
0f7095f53ca3
Extend svnrepos with SubversionRepo and SVNMeta
Patrick Mezard <pmezard@gmail.com>
parents:
463
diff
changeset
|
17 import svnrepo |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
18 import util |
291
ba8e91a7c077
Add 'updateexternals' to synchronize externals with remote repo.
Patrick Mezard <pmezard@gmail.com>
parents:
274
diff
changeset
|
19 import svnexternals |
897
6bc8046e3d0a
move verify to a file of its own
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
893
diff
changeset
|
20 import verify |
1162
cb14dba562eb
svncommands: add svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1152
diff
changeset
|
21 import svnmeta |
241
4950b18cf949
Move fetch_command.fetch_revisions() to svncommands.pull().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
22 |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
23 |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
24 def updatemeta(ui, repo, args, **opts): |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
25 """Do a partial rebuild of the subversion metadata. |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
26 |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
27 Assumes that the metadata that currently exists is valid, but that |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
28 some is missing, e.g. because you have pulled some revisions via a |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
29 native mercurial method. |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
30 |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
31 """ |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
32 |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
33 return _buildmeta(ui, repo, args, partial=True) |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
34 |
395
636e9bf5d49c
svncommands: add verify command
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
384
diff
changeset
|
35 |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
36 def rebuildmeta(ui, repo, args, unsafe_skip_uuid_check=False, **opts): |
246
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
37 """rebuild hgsubversion metadata using values stored in revisions |
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
38 """ |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
39 return _buildmeta(ui, repo, args, partial=False, |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
40 skipuuid=unsafe_skip_uuid_check) |
573
00393e9abff8
svncommands: make repo optional (useful for things like listauthors)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
566
diff
changeset
|
41 |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
42 def _buildmeta(ui, repo, args, partial=False, skipuuid=False): |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
43 |
573
00393e9abff8
svncommands: make repo optional (useful for things like listauthors)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
566
diff
changeset
|
44 if repo is None: |
00393e9abff8
svncommands: make repo optional (useful for things like listauthors)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
566
diff
changeset
|
45 raise error.RepoError("There is no Mercurial repository" |
00393e9abff8
svncommands: make repo optional (useful for things like listauthors)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
566
diff
changeset
|
46 " here (.hg not found)") |
00393e9abff8
svncommands: make repo optional (useful for things like listauthors)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
566
diff
changeset
|
47 |
453
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
48 dest = None |
1002
117b3b421294
buildmeta: verify uuid when passed explicit url
David Schleimer <dschleimer@fb.com>
parents:
997
diff
changeset
|
49 validateuuid = False |
453
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
50 if len(args) == 1: |
419
3ed71e63f64c
imported patch import-cleanup
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
414
diff
changeset
|
51 dest = args[0] |
1002
117b3b421294
buildmeta: verify uuid when passed explicit url
David Schleimer <dschleimer@fb.com>
parents:
997
diff
changeset
|
52 validateuuid = True |
453
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
53 elif len(args) > 1: |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
54 raise hgutil.Abort('rebuildmeta takes 1 or no arguments') |
754
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
748
diff
changeset
|
55 url = repo.ui.expandpath(dest or repo.ui.config('paths', 'default-push') or |
caa527346a0f
svncommands: abort on missing metadata or Subversion URL (fixes #226)
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
748
diff
changeset
|
56 repo.ui.config('paths', 'default') or '') |
1162
cb14dba562eb
svncommands: add svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1152
diff
changeset
|
57 |
cb14dba562eb
svncommands: add svnmeta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1152
diff
changeset
|
58 meta = svnmeta.SVNMeta(repo, skiperrorcheck=True) |
246
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
59 |
997
c8cb06e1f323
buildmeta: do not contact svn unless needed
Bryan O'Sullivan <bryano@fb.com>
parents:
996
diff
changeset
|
60 svn = None |
1165
eba7de99c576
svncommands: use meta.subdir instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1164
diff
changeset
|
61 if meta.subdir is None: |
997
c8cb06e1f323
buildmeta: do not contact svn unless needed
Bryan O'Sullivan <bryano@fb.com>
parents:
996
diff
changeset
|
62 svn = svnrepo.svnremoterepo(ui, url).svn |
1165
eba7de99c576
svncommands: use meta.subdir instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1164
diff
changeset
|
63 meta.subdir = svn.subdir |
246
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
64 |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
65 youngest = 0 |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
66 startrev = 0 |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
67 branchinfo = {} |
1420
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
68 revmap = meta.revmap |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
69 if partial: |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
70 try: |
1185
65ca78ac2ee1
svncommands: use meta.lastpulled instead of revmap.youngest
Sean Farley <sean.michael.farley@gmail.com>
parents:
1182
diff
changeset
|
71 # we can't use meta.lastpulled here because we are bootstraping the |
65ca78ac2ee1
svncommands: use meta.lastpulled instead of revmap.youngest
Sean Farley <sean.michael.farley@gmail.com>
parents:
1182
diff
changeset
|
72 # lastpulled and want to keep the cached value on disk during a |
65ca78ac2ee1
svncommands: use meta.lastpulled instead of revmap.youngest
Sean Farley <sean.michael.farley@gmail.com>
parents:
1182
diff
changeset
|
73 # partial rebuild |
922
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
74 foundpartialinfo = False |
1185
65ca78ac2ee1
svncommands: use meta.lastpulled instead of revmap.youngest
Sean Farley <sean.michael.farley@gmail.com>
parents:
1182
diff
changeset
|
75 youngestpath = os.path.join(meta.metapath, 'lastpulled') |
922
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
76 if os.path.exists(youngestpath): |
1142
f4a32d381e03
util: remove all calls to load_string
Sean Farley <sean.michael.farley@gmail.com>
parents:
1132
diff
changeset
|
77 youngest = util.load(youngestpath) |
1420
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
78 lasthash = revmap.lasthash |
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
79 if len(revmap) > 0 and lasthash: |
922
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
80 startrev = repo[lasthash].rev() + 1 |
1166
8a1bf7d011c3
svncommands: use meta.branch_info instead of duplicating logic
Sean Farley <sean.michael.farley@gmail.com>
parents:
1165
diff
changeset
|
81 branchinfo = util.load(meta.branch_info_file) |
922
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
82 foundpartialinfo = True |
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
83 if not foundpartialinfo: |
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
84 ui.status('missing some metadata -- doing a full rebuild\n') |
6b7ac659c855
updatemeta: correctly handle empty metadata
Jun Fang <junfang@fb.com>
parents:
918
diff
changeset
|
85 partial = False |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
86 except IOError, err: |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
87 if err.errno != errno.ENOENT: |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
88 raise |
988
06d0009b22ad
updatemeta: add missing EOL to status messages
Patrick Mezard <patrick@mezard.eu>
parents:
922
diff
changeset
|
89 ui.status('missing some metadata -- doing a full rebuild\n') |
913
9fff2b8217b6
add except for AttributeError if youngestrepo doesn't exist
Brad Hall <bhall@fb.com>
parents:
897
diff
changeset
|
90 except AttributeError: |
988
06d0009b22ad
updatemeta: add missing EOL to status messages
Patrick Mezard <patrick@mezard.eu>
parents:
922
diff
changeset
|
91 ui.status('no metadata available -- doing a full rebuild\n') |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
92 |
1420
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
93 if not partial: |
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
94 revmap.clear() |
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
95 |
246
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
96 last_rev = -1 |
1167
4f31a0a6fc86
svncommands: use meta.tags instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1166
diff
changeset
|
97 if not partial and os.path.exists(meta.tagfile): |
4f31a0a6fc86
svncommands: use meta.tags instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1166
diff
changeset
|
98 os.unlink(meta.tagfile) |
452
ae35c389cdef
tags: allow editing tags of closed branches without reopening the branch
Augie Fackler <durin42@gmail.com>
parents:
448
diff
changeset
|
99 |
ae35c389cdef
tags: allow editing tags of closed branches without reopening the branch
Augie Fackler <durin42@gmail.com>
parents:
448
diff
changeset
|
100 skipped = set() |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
101 closed = set() |
452
ae35c389cdef
tags: allow editing tags of closed branches without reopening the branch
Augie Fackler <durin42@gmail.com>
parents:
448
diff
changeset
|
102 |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
103 numrevs = len(repo) - startrev |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
104 |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
105 # ctx.children() visits all revisions in the repository after ctx. Calling |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
106 # it would make us use O(revisions^2) time, so we perform an extra traversal |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
107 # of the repository instead. During this traversal, we find all converted |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
108 # changesets that close a branch, and store their first parent |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
109 for rev in xrange(startrev, len(repo)): |
1039
3df6ed4e7561
drop support for pre-2.0 versions of Mercurial
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1033
diff
changeset
|
110 ui.progress('prepare', rev - startrev, total=numrevs) |
1019
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
111 try: |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
112 ctx = repo[rev] |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
113 except error.RepoError: |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
114 # this revision is hidden |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
115 continue |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
116 |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
117 convinfo = util.getsvnrev(ctx, None) |
821
f28e0f54a6ef
svnmeta: store youngest revision pulled from subversion
Augie Fackler <durin42@gmail.com>
parents:
810
diff
changeset
|
118 if not convinfo: |
f28e0f54a6ef
svnmeta: store youngest revision pulled from subversion
Augie Fackler <durin42@gmail.com>
parents:
810
diff
changeset
|
119 continue |
f28e0f54a6ef
svnmeta: store youngest revision pulled from subversion
Augie Fackler <durin42@gmail.com>
parents:
810
diff
changeset
|
120 svnrevnum = int(convinfo.rsplit('@', 1)[1]) |
f28e0f54a6ef
svnmeta: store youngest revision pulled from subversion
Augie Fackler <durin42@gmail.com>
parents:
810
diff
changeset
|
121 youngest = max(youngest, svnrevnum) |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
122 |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
123 if ctx.extra().get('close', None) is None: |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
124 continue |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
125 |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
126 droprev = lambda x: x.rsplit('@', 1)[0] |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
127 parentctx = ctx.parents()[0] |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
128 parentinfo = util.getsvnrev(parentctx, '@') |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
129 |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
130 if droprev(parentinfo) == droprev(convinfo): |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
131 if parentctx.rev() < startrev: |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
132 parentbranch = parentctx.branch() |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
133 if parentbranch == 'default': |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
134 parentbranch = None |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
135 branchinfo.pop(parentbranch) |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
136 else: |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
137 closed.add(parentctx.rev()) |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
138 |
1039
3df6ed4e7561
drop support for pre-2.0 versions of Mercurial
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1033
diff
changeset
|
139 ui.progress('prepare', None, total=numrevs) |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
140 |
1420
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
141 revmapbuf = [] |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
142 for rev in xrange(startrev, len(repo)): |
1039
3df6ed4e7561
drop support for pre-2.0 versions of Mercurial
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1033
diff
changeset
|
143 ui.progress('rebuild', rev-startrev, total=numrevs) |
1019
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
144 try: |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
145 ctx = repo[rev] |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
146 except error.RepoError: |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
147 # this revision is hidden |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
148 continue |
d0f3a5c2cb56
updatemeta/rebuildmeta: handle hidden changesets
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
922
diff
changeset
|
149 |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
150 convinfo = util.getsvnrev(ctx, None) |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
151 if not convinfo: |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
152 continue |
448
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
153 if '.hgtags' in ctx.files(): |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
154 parent = ctx.parents()[0] |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
155 parentdata = '' |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
156 if '.hgtags' in parent: |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
157 parentdata = parent.filectx('.hgtags').data() |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
158 newdata = ctx.filectx('.hgtags').data() |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
159 for newtag in newdata[len(parentdata):-1].split('\n'): |
fbc7cf4fd701
tags: reinstate a tag map file in a better way
Augie Fackler <durin42@gmail.com>
parents:
447
diff
changeset
|
160 ha, tag = newtag.split(' ', 1) |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
161 tagged = util.getsvnrev(repo[ha], None) |
453
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
162 if tagged is None: |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
163 tagged = -1 |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
164 else: |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
165 tagged = int(tagged[40:].split('@')[1]) |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
166 # This is max(tagged rev, tagging rev) because if it is a normal |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
167 # tag, the tagging revision has the right rev number. However, if it |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
168 # was an edited tag, then the tagged revision has the correct revision |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
169 # number. |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
170 tagging = int(convinfo[40:].split('@')[1]) |
bb612e625be6
tags: handle copyfrom old versions of tags more correctly
Augie Fackler <durin42@gmail.com>
parents:
452
diff
changeset
|
171 tagrev = max(tagged, tagging) |
1167
4f31a0a6fc86
svncommands: use meta.tags instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1166
diff
changeset
|
172 meta.tags[tag] = node.bin(ha), tagrev |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
173 |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
174 # check that the conversion metadata matches expectations |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
175 assert convinfo.startswith('svn:') |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
176 revpath, revision = convinfo[40:].split('@') |
1165
eba7de99c576
svncommands: use meta.subdir instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1164
diff
changeset
|
177 # use tmp variable for testing |
eba7de99c576
svncommands: use meta.subdir instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1164
diff
changeset
|
178 subdir = meta.subdir |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
179 if subdir and subdir[0] != '/': |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
180 subdir = '/' + subdir |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
181 if subdir and subdir[-1] == '/': |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
182 subdir = subdir[:-1] |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
183 assert revpath.startswith(subdir), ('That does not look like the ' |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
184 'right location in the repo.') |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
185 |
1317
62fc5850eb28
svncommads: document the auto layout block
Sean Farley <sean.michael.farley@gmail.com>
parents:
1313
diff
changeset
|
186 # meta.layout is a config-cached property so instead of testing for |
62fc5850eb28
svncommads: document the auto layout block
Sean Farley <sean.michael.farley@gmail.com>
parents:
1313
diff
changeset
|
187 # None we test to see if the layout is 'auto' and, if so, try to guess |
62fc5850eb28
svncommads: document the auto layout block
Sean Farley <sean.michael.farley@gmail.com>
parents:
1313
diff
changeset
|
188 # the layout based on the commits (where subdir is compared to the |
62fc5850eb28
svncommads: document the auto layout block
Sean Farley <sean.michael.farley@gmail.com>
parents:
1313
diff
changeset
|
189 # revpath extracted from the commit) |
1313
5f80c92be718
svncommands: rip out layout logic and use meta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1292
diff
changeset
|
190 if meta.layout == 'auto': |
1317
62fc5850eb28
svncommads: document the auto layout block
Sean Farley <sean.michael.farley@gmail.com>
parents:
1313
diff
changeset
|
191 meta.layout = meta.layout_from_commit(subdir, revpath, |
62fc5850eb28
svncommads: document the auto layout block
Sean Farley <sean.michael.farley@gmail.com>
parents:
1313
diff
changeset
|
192 ctx.branch()) |
1313
5f80c92be718
svncommands: rip out layout logic and use meta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1292
diff
changeset
|
193 elif meta.layout == 'single': |
499
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
493
diff
changeset
|
194 assert (subdir or '/') == revpath, ('Possible layout detection' |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
493
diff
changeset
|
195 ' defect in replay') |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
493
diff
changeset
|
196 |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
197 # write repository uuid if required |
1164
52de1f3b6824
svncommands: use meta.uuid instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1163
diff
changeset
|
198 if meta.uuid is None or validateuuid: |
1002
117b3b421294
buildmeta: verify uuid when passed explicit url
David Schleimer <dschleimer@fb.com>
parents:
997
diff
changeset
|
199 validateuuid = False |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
200 uuid = convinfo[4:40] |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
201 if not skipuuid: |
997
c8cb06e1f323
buildmeta: do not contact svn unless needed
Bryan O'Sullivan <bryano@fb.com>
parents:
996
diff
changeset
|
202 if svn is None: |
c8cb06e1f323
buildmeta: do not contact svn unless needed
Bryan O'Sullivan <bryano@fb.com>
parents:
996
diff
changeset
|
203 svn = svnrepo.svnremoterepo(ui, url).svn |
918
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
204 if uuid != svn.uuid: |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
205 raise hgutil.Abort('remote svn repository identifier ' |
761a87134501
rebuildmeta: accept unrelated svn repo with --unsafe-skip-uuid-check
Patrick Mezard <patrick@mezard.eu>
parents:
913
diff
changeset
|
206 'does not match') |
1164
52de1f3b6824
svncommands: use meta.uuid instead of duplicating code
Sean Farley <sean.michael.farley@gmail.com>
parents:
1163
diff
changeset
|
207 meta.uuid = uuid |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
208 |
423
021bdbf391bb
put convert_revision in branch-closing csets
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
419
diff
changeset
|
209 # don't reflect closed branches |
452
ae35c389cdef
tags: allow editing tags of closed branches without reopening the branch
Augie Fackler <durin42@gmail.com>
parents:
448
diff
changeset
|
210 if (ctx.extra().get('close') and not ctx.files() or |
ae35c389cdef
tags: allow editing tags of closed branches without reopening the branch
Augie Fackler <durin42@gmail.com>
parents:
448
diff
changeset
|
211 ctx.parents()[0].node() in skipped): |
ae35c389cdef
tags: allow editing tags of closed branches without reopening the branch
Augie Fackler <durin42@gmail.com>
parents:
448
diff
changeset
|
212 skipped.add(ctx.node()) |
423
021bdbf391bb
put convert_revision in branch-closing csets
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
419
diff
changeset
|
213 continue |
021bdbf391bb
put convert_revision in branch-closing csets
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
419
diff
changeset
|
214 |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
215 # find commitpath, write to revmap |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
216 commitpath = revpath[len(subdir)+1:] |
1033
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
217 |
1313
5f80c92be718
svncommands: rip out layout logic and use meta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1292
diff
changeset
|
218 tag_locations = meta.layoutobj.taglocations |
1033
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
219 found_tag = False |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
220 for location in tag_locations: |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
221 if commitpath.startswith(location + '/'): |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
222 found_tag = True |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
223 break |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
224 if found_tag and ctx.extra().get('close'): |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
225 continue |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
226 |
1313
5f80c92be718
svncommands: rip out layout logic and use meta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1292
diff
changeset
|
227 branch = meta.layoutobj.localname(commitpath) |
1420
014c47a8e653
svncommands: get rid of RevMap.readmapfile
Jun Wu <quark@fb.com>
parents:
1377
diff
changeset
|
228 revmapbuf.append((revision, branch, ctx.node())) |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
229 |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
230 revision = int(revision) |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
231 if revision > last_rev: |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
232 last_rev = revision |
375
af9fc01299b4
Make branch closing more Mercurial-like.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
371
diff
changeset
|
233 |
af9fc01299b4
Make branch closing more Mercurial-like.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
371
diff
changeset
|
234 # deal with branches |
1033
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
235 if branch and branch.startswith('../'): |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
236 parent = ctx |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
237 while parent.node() != node.nullid: |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
238 parentextra = parent.extra() |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
239 parentinfo = util.getsvnrev(parent) |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
240 assert parentinfo |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
241 parent = parent.parents()[0] |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
242 |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
243 parentpath = parentinfo[40:].split('@')[0][len(subdir) + 1:] |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
244 |
1033
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
245 found_tag = False |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
246 for location in tag_locations: |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
247 if parentpath.startswith(location + '/'): |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
248 found_tag = True |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
249 break |
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
250 if found_tag and parentextra.get('close'): |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
251 continue |
1033
32f6b970c762
buildmeta: use layouts library for branch and tag mapping in _buildmeta
David Schleimer <dschleimer@fb.com>
parents:
1021
diff
changeset
|
252 |
1313
5f80c92be718
svncommands: rip out layout logic and use meta object
Sean Farley <sean.michael.farley@gmail.com>
parents:
1292
diff
changeset
|
253 branch = meta.layoutobj.localname(parentpath) |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
254 break |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
255 |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
256 if rev in closed: |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
257 # a direct child of this changeset closes the branch; drop it |
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
258 branchinfo.pop(branch, None) |
641
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
259 elif ctx.extra().get('close'): |
67513cca972f
rebuildmeta: handle mapped branch names.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
637
diff
changeset
|
260 pass |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
261 elif branch not in branchinfo: |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
262 parent = ctx.parents()[0] |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
263 if (parent.node() not in skipped |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
264 and util.getsvnrev(parent, '').startswith('svn:') |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
265 and parent.branch() != ctx.branch()): |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
266 parentbranch = parent.branch() |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
267 if parentbranch == 'default': |
246
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
268 parentbranch = None |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
269 else: |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
270 parentbranch = None |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
271 # branchinfo is a map from mercurial branch to a |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
272 # (svn branch, svn parent revision, svn revision) tuple |
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
273 parentrev = util.getsvnrev(parent, '@').split('@')[1] or 0 |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
274 branchinfo[branch] = (parentbranch, |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
275 int(parentrev), |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
276 revision) |
637
92f4a4b60696
rebuildmeta: optimize by removing quadratic time usage
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
616
diff
changeset
|
277 |
1434
0a6b3da6d34c
RevMap: move lastpulled from SVNMeta down into RevMap
Augie Fackler <raf@durin42.com>
parents:
1420
diff
changeset
|
278 revmap.batchset(revmapbuf, youngest) |
1039
3df6ed4e7561
drop support for pre-2.0 versions of Mercurial
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1033
diff
changeset
|
279 ui.progress('rebuild', None, total=numrevs) |
371
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
280 |
b45671850969
Add some comments for rebuildmeta, simplify a little.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
342
diff
changeset
|
281 # save off branch info |
1166
8a1bf7d011c3
svncommands: use meta.branch_info instead of duplicating logic
Sean Farley <sean.michael.farley@gmail.com>
parents:
1165
diff
changeset
|
282 util.dump(branchinfo, meta.branch_info_file) |
246
074f27c68818
Move rebuildmeta into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
244
diff
changeset
|
283 |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
284 |
595
200770235bf0
svncommands: rename the `help' function to `help_'.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
580
diff
changeset
|
285 def help_(ui, args=None, **opts): |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
286 """show help for a given subcommands or a help overview |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
287 """ |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
288 if args: |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
289 subcommand = args[0] |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
290 if subcommand not in table: |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
291 candidates = [] |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
292 for c in table: |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
293 if c.startswith(subcommand): |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
294 candidates.append(c) |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
295 if len(candidates) == 1: |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
296 subcommand = candidates[0] |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
297 elif len(candidates) > 1: |
603
24c73f35f3cf
metacommand: use AmbiguousCommand from hg for consistency.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
599
diff
changeset
|
298 raise error.AmbiguousCommand(subcommand, candidates) |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
299 return |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
300 doc = table[subcommand].__doc__ |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
301 if doc is None: |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
302 doc = "No documentation available for %s." % subcommand |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
303 ui.status(doc.strip(), '\n') |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
304 return |
598
e432b61c6d74
Use Mercurial-provided infrastructure for `svn' metacommand help.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
595
diff
changeset
|
305 commands.help_(ui, 'svn') |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
306 |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
307 |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
308 def update(ui, args, repo, clean=False, **opts): |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
309 """update to a specified Subversion revision number |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
310 """ |
446
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
311 |
755
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
312 try: |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
313 rev = int(args[0]) |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
314 except IndexError: |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
315 raise error.CommandError('svn', |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
316 "no revision number specified for 'update'") |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
317 except ValueError: |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
318 raise error.Abort("'%s' is not a valid Subversion revision number" |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
319 % args[0]) |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
320 |
464
0f7095f53ca3
Extend svnrepos with SubversionRepo and SVNMeta
Patrick Mezard <pmezard@gmail.com>
parents:
463
diff
changeset
|
321 meta = repo.svnmeta() |
446
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
322 |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
323 answers = [] |
446
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
324 for k, v in meta.revmap.iteritems(): |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
325 if k[0] == rev: |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
326 answers.append((v, k[1])) |
446
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
327 |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
328 if len(answers) == 1: |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
329 if clean: |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
330 return hg.clean(repo, answers[0][0]) |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
331 return hg.update(repo, answers[0][0]) |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
332 elif len(answers) == 0: |
446
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
333 ui.status('revision %s did not produce an hg revision\n' % rev) |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
334 return 1 |
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
335 else: |
446
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
336 ui.status('ambiguous revision!\n') |
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
337 revs = ['%s on %s' % (node.hex(a[0]), a[1]) for a in answers] + [''] |
cbd230043379
svncommands: get update working again
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
441
diff
changeset
|
338 ui.status('\n'.join(revs)) |
247
1272e87546ed
Move help, update into svncommands.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
246
diff
changeset
|
339 return 1 |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
340 |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
341 |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
342 def genignore(ui, repo, force=False, **opts): |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
343 """generate .hgignore from svn:ignore properties. |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
344 """ |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
345 |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
346 if repo is None: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
347 raise error.RepoError("There is no Mercurial repository" |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
348 " here (.hg not found)") |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
349 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
350 ignpath = repo.wjoin('.hgignore') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
351 if not force and os.path.exists(ignpath): |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
352 raise hgutil.Abort('not overwriting existing .hgignore, try --force?') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
353 svn = svnrepo.svnremoterepo(repo.ui).svn |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
354 meta = repo.svnmeta() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
355 hashes = meta.revmap.hashes() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
356 parent = util.parentrev(ui, repo, meta, hashes) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
357 r, br = hashes[parent.node()] |
1015
ea6109f5c000
layouts: use layouts library for branch mapping with generating .hgignore
David Schleimer <dschleimer@fb.com>
parents:
1007
diff
changeset
|
358 branchpath = meta.layoutobj.remotename(br) |
ea6109f5c000
layouts: use layouts library for branch mapping with generating .hgignore
David Schleimer <dschleimer@fb.com>
parents:
1007
diff
changeset
|
359 if branchpath: |
ea6109f5c000
layouts: use layouts library for branch mapping with generating .hgignore
David Schleimer <dschleimer@fb.com>
parents:
1007
diff
changeset
|
360 branchpath += '/' |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
361 ignorelines = ['.hgignore', 'syntax:glob'] |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
362 dirs = [''] + [d[0] for d in svn.list_files(branchpath, r) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
363 if d[1] == 'd'] |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
364 for dir in dirs: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
365 path = '%s%s' % (branchpath, dir) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
366 props = svn.list_props(path, r) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
367 if 'svn:ignore' not in props: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
368 continue |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
369 lines = props['svn:ignore'].strip().split('\n') |
1258
85fe080461c6
genignore: fitler out empty lines in svn:ignore.
peter.geer
parents:
1185
diff
changeset
|
370 ignorelines += [dir and (dir + '/' + prop) or prop for prop in lines if prop.strip()] |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
371 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
372 repo.wopener('.hgignore', 'w').write('\n'.join(ignorelines) + '\n') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
373 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
374 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
375 def info(ui, repo, **opts): |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
376 """show Subversion details similar to `svn info' |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
377 """ |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
378 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
379 if repo is None: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
380 raise error.RepoError("There is no Mercurial repository" |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
381 " here (.hg not found)") |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
382 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
383 meta = repo.svnmeta() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
384 hashes = meta.revmap.hashes() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
385 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
386 if opts.get('rev'): |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
387 parent = repo[opts['rev']] |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
388 else: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
389 parent = util.parentrev(ui, repo, meta, hashes) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
390 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
391 pn = parent.node() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
392 if pn not in hashes: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
393 ui.status('Not a child of an svn revision.\n') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
394 return 0 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
395 r, br = hashes[pn] |
884
1b261e0f85aa
Abstract away the details of where svn revs are stored in a commit
Bryan O'Sullivan <bryano@fb.com>
parents:
881
diff
changeset
|
396 subdir = util.getsvnrev(parent)[40:].split('@')[0] |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
397 remoterepo = svnrepo.svnremoterepo(repo.ui) |
1016
438dc704b0d6
layouts: use layout library in hg svn info
David Schleimer <dschleimer@fb.com>
parents:
1015
diff
changeset
|
398 url = meta.layoutobj.remotepath(br, remoterepo.svnurl) |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
399 author = meta.authors.reverselookup(parent.user()) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
400 # cleverly figure out repo root w/o actually contacting the server |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
401 reporoot = url[:len(url)-len(subdir)] |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
402 ui.write('''URL: %(url)s |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
403 Repository Root: %(reporoot)s |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
404 Repository UUID: %(uuid)s |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
405 Revision: %(revision)s |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
406 Node Kind: directory |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
407 Last Changed Author: %(author)s |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
408 Last Changed Rev: %(revision)s |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
409 Last Changed Date: %(date)s\n''' % |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
410 {'reporoot': reporoot, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
411 'uuid': meta.uuid, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
412 'url': url, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
413 'author': author, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
414 'revision': r, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
415 # TODO I'd like to format this to the user's local TZ if possible |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
416 'date': hgutil.datestr(parent.date(), |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
417 '%Y-%m-%d %H:%M:%S %1%2 (%a, %d %b %Y)') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
418 }) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
419 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
420 |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
421 def listauthors(ui, args, authors=None, **opts): |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
422 """list all authors in a Subversion repository |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
423 """ |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
424 if not len(args): |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
425 ui.status('No repository specified.\n') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
426 return |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
427 svn = svnrepo.svnremoterepo(ui, args[0]).svn |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
428 author_set = set() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
429 for rev in svn.revisions(): |
735
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
728
diff
changeset
|
430 if rev.author is None: |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
728
diff
changeset
|
431 author_set.add('(no author)') |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
728
diff
changeset
|
432 else: |
c2b9e08ecf10
maps: map a missing author to '(no author)'
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
728
diff
changeset
|
433 author_set.add(rev.author) |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
434 if authors: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
435 authorfile = open(authors, 'w') |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
436 authorfile.write('%s=\n' % '=\n'.join(sorted(author_set))) |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
437 authorfile.close() |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
438 else: |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
439 ui.write('%s\n' % '\n'.join(sorted(author_set))) |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
440 |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
441 |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
442 def _helpgen(): |
598
e432b61c6d74
Use Mercurial-provided infrastructure for `svn' metacommand help.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
595
diff
changeset
|
443 ret = ['subcommands for Subversion integration', '', |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
444 'list of subcommands:', ''] |
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
445 for name, func in sorted(table.items()): |
504
bc117ea4c95a
do not assume that doc-strings are present.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
499
diff
changeset
|
446 if func.__doc__: |
bc117ea4c95a
do not assume that doc-strings are present.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
499
diff
changeset
|
447 short_description = func.__doc__.splitlines()[0] |
bc117ea4c95a
do not assume that doc-strings are present.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
499
diff
changeset
|
448 else: |
bc117ea4c95a
do not assume that doc-strings are present.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
499
diff
changeset
|
449 short_description = '' |
598
e432b61c6d74
Use Mercurial-provided infrastructure for `svn' metacommand help.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
595
diff
changeset
|
450 ret.append(" :%s: %s" % (name, short_description)) |
253
c3d5c4ae9c7c
Work with simple command table instead of decorators.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
247
diff
changeset
|
451 return '\n'.join(ret) + '\n' |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
452 |
599
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
453 def svn(ui, repo, subcommand, *args, **opts): |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
454 '''see detailed help for list of subcommands''' |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
455 |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
456 # guess command if prefix |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
457 if subcommand not in table: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
458 candidates = [] |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
459 for c in table: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
460 if c.startswith(subcommand): |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
461 candidates.append(c) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
462 if len(candidates) == 1: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
463 subcommand = candidates[0] |
755
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
464 elif not candidates: |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
465 raise error.CommandError('svn', |
9c9565643704
svn metacommand: improved argument checking
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
754
diff
changeset
|
466 "unknown subcommand '%s'" % subcommand) |
599
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
467 else: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
468 raise error.AmbiguousCommand(subcommand, candidates) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
469 |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
470 # override subversion credentials |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
471 for key in ('username', 'password'): |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
472 if key in opts: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
473 ui.setconfig('hgsubversion', key, opts[key]) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
474 |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
475 try: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
476 commandfunc = table[subcommand] |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
477 return commandfunc(ui, args=args, repo=repo, **opts) |
611
b70f7c82b9b8
svncommands: fix layering violation & tweak error messages.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
603
diff
changeset
|
478 except svnwrap.SubversionConnectionException, e: |
b70f7c82b9b8
svncommands: fix layering violation & tweak error messages.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
603
diff
changeset
|
479 raise hgutil.Abort(*e.args) |
599
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
480 except TypeError: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
481 tb = traceback.extract_tb(sys.exc_info()[2]) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
482 if len(tb) == 1: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
483 ui.status('Bad arguments for subcommand %s\n' % subcommand) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
484 else: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
485 raise |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
486 except KeyError, e: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
487 tb = traceback.extract_tb(sys.exc_info()[2]) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
488 if len(tb) == 1: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
489 ui.status('Unknown subcommand %s\n' % subcommand) |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
490 else: |
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
491 raise |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
492 |
1377
2ae4fb5bfab9
svncommands: cope with aa73d6a5d9ea which removed optionalrepo
Augie Fackler <raf@durin42.com>
parents:
1317
diff
changeset
|
493 svn.optionalrepo=True |
2ae4fb5bfab9
svncommands: cope with aa73d6a5d9ea which removed optionalrepo
Augie Fackler <raf@durin42.com>
parents:
1317
diff
changeset
|
494 svn.norepo = False |
2ae4fb5bfab9
svncommands: cope with aa73d6a5d9ea which removed optionalrepo
Augie Fackler <raf@durin42.com>
parents:
1317
diff
changeset
|
495 |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
496 table = { |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
497 'genignore': genignore, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
498 'info': info, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
499 'listauthors': listauthors, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
500 'update': update, |
595
200770235bf0
svncommands: rename the `help' function to `help_'.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
580
diff
changeset
|
501 'help': help_, |
890
78db88de9622
Partial metadata rebuilding
David Schleimer <dschleimer@fb.com>
parents:
885
diff
changeset
|
502 'updatemeta': updatemeta, |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
503 'rebuildmeta': rebuildmeta, |
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
504 'updateexternals': svnexternals.updateexternals, |
897
6bc8046e3d0a
move verify to a file of its own
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
893
diff
changeset
|
505 'verify': verify.verify, |
578
de384e4e0423
merge commands from utility_commands into svncommands
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
573
diff
changeset
|
506 } |
599
408869906fbf
Move the 'svn' metacommand into the 'svncommands' module.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
598
diff
changeset
|
507 svn.__doc__ = _helpgen() |