Mercurial > hgsubversion
annotate hgsubversion/editor.py @ 421:8277113036f1
editor: rename hg_delta_editor.HgChangeReceiver to editor.HgEditor
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Thu, 11 Jun 2009 19:15:18 +0200 |
parents | hgsubversion/hg_delta_editor.py@59e19c73b0df |
children | 6086363e8230 |
rev | line source |
---|---|
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
1 import cStringIO |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
2 import sys |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
3 import traceback |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
4 |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
5 from mercurial import context |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
6 from mercurial import util as hgutil |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
7 from mercurial import revlog |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
8 from mercurial import node |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
9 from svn import delta |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
10 from svn import core |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
11 |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
12 import svnexternals |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
13 import util |
34
50d55c3e0d85
Some refactors of the previous change, including transparent upgrade of old-style pickled dictionaries.
Augie Fackler <durin42@gmail.com>
parents:
33
diff
changeset
|
14 |
363
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
15 class MissingPlainTextError(Exception): |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
16 """Exception raised when the repo lacks a source file required for replaying |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
17 a txdelta. |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
18 """ |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
19 |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
20 class ReplayException(Exception): |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
21 """Exception raised when you try and commit but the replay encountered an |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
22 exception. |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
23 """ |
ccef78b91ac9
Move exception classes in hg_delta_editor up top.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
362
diff
changeset
|
24 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
25 def ieditor(fn): |
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
26 """Helps identify methods used by the SVN editor interface. |
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
27 |
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
28 Stash any exception raised in the method on self. |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
29 |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
30 This is required because the SWIG bindings just mutate any exception into |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
31 a generic Subversion exception with no way of telling what the original was. |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
32 This allows the editor object to notice when you try and commit and really |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
33 got an exception in the replay process. |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
34 """ |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
35 def fun(self, *args, **kwargs): |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
36 try: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
37 return fn(self, *args, **kwargs) |
146
4da9f20aef01
Add some more coverage directives.
Augie Fackler <durin42@gmail.com>
parents:
145
diff
changeset
|
38 except: #pragma: no cover |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
39 if not hasattr(self, '_exception_info'): |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
40 self._exception_info = sys.exc_info() |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
41 raise |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
42 return fun |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
43 |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
44 |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
45 class RevisionData(object): |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
46 |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
47 __slots__ = [ |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
48 'file', 'files', 'deleted', 'rev', 'execfiles', 'symlinks', 'batons', |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
49 'copies', 'missing', 'emptybranches', 'base', 'externals', |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
50 ] |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
51 |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
52 def __init__(self): |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
53 self.clear() |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
54 |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
55 def clear(self): |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
56 self.file = None |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
57 self.files = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
58 self.deleted = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
59 self.rev = None |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
60 self.execfiles = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
61 self.symlinks = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
62 self.batons = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
63 # Map fully qualified destination file paths to module source path |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
64 self.copies = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
65 self.missing = set() |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
66 self.emptybranches = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
67 self.base = None |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
68 self.externals = {} |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
69 |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
70 |
421
8277113036f1
editor: rename hg_delta_editor.HgChangeReceiver to editor.HgEditor
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
420
diff
changeset
|
71 class HgEditor(delta.Editor): |
33
a9c15cae50e5
Faster append-only revmap implementation.
Andreas Hartmetz <ahartmetz@gmail.com>
parents:
23
diff
changeset
|
72 |
416
cd6317fe70be
invert the svnmeta/editor relationship
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
415
diff
changeset
|
73 def __init__(self, meta): |
cd6317fe70be
invert the svnmeta/editor relationship
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
415
diff
changeset
|
74 self.meta = meta |
cd6317fe70be
invert the svnmeta/editor relationship
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
415
diff
changeset
|
75 self.ui = meta.ui |
cd6317fe70be
invert the svnmeta/editor relationship
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
415
diff
changeset
|
76 self.repo = meta.repo |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
77 self.current = RevisionData() |
413
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
78 |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
79 def set_file(self, path, data, isexec=False, islink=False): |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
80 if islink: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
81 data = 'link ' + data |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
82 self.current.files[path] = data |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
83 self.current.execfiles[path] = isexec |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
84 self.current.symlinks[path] = islink |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
85 if path in self.current.deleted: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
86 del self.current.deleted[path] |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
87 if path in self.current.missing: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
88 self.current.missing.remove(path) |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
89 |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
90 def delete_file(self, path): |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
91 self.current.deleted[path] = True |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
92 if path in self.current.files: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
93 del self.current.files[path] |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
94 self.current.execfiles[path] = False |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
95 self.current.symlinks[path] = False |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
96 self.ui.note('D %s\n' % path) |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
97 |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
98 def _updateexternals(self): |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
99 if not self.current.externals: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
100 return |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
101 # Accumulate externals records for all branches |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
102 revnum = self.current.rev.revnum |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
103 branches = {} |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
104 for path, entry in self.current.externals.iteritems(): |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
105 if not self.meta.is_path_valid(path): |
413
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
106 self.ui.warn('WARNING: Invalid path %s in externals\n' % path) |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
107 continue |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
108 p, b, bp = self.meta.split_branch_path(path) |
413
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
109 if bp not in branches: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
110 external = svnexternals.externalsfile() |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
111 parent = self.meta.get_parent_revision(revnum, b) |
413
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
112 pctx = self.repo[parent] |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
113 if '.hgsvnexternals' in pctx: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
114 external.read(pctx['.hgsvnexternals'].data()) |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
115 branches[bp] = external |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
116 else: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
117 external = branches[bp] |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
118 external[p] = entry |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
119 |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
120 # Register the file changes |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
121 for bp, external in branches.iteritems(): |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
122 path = bp + '/.hgsvnexternals' |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
123 if external: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
124 self.set_file(path, external.write(), False, False) |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
125 else: |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
126 self.delete_file(path) |
ac0cc3c9ea63
sort HgChangeReceiver methods and properties
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
411
diff
changeset
|
127 |
367
ce64d57172a3
Generate separate data structure containing revision's tags/branches changes.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
365
diff
changeset
|
128 def commit_current_delta(self, tbdelta): |
146
4da9f20aef01
Add some more coverage directives.
Augie Fackler <durin42@gmail.com>
parents:
145
diff
changeset
|
129 if hasattr(self, '_exception_info'): #pragma: no cover |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
130 traceback.print_exception(*self._exception_info) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
131 raise ReplayException() |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
132 if self.current.missing: |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
133 raise MissingPlainTextError() |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
134 self._updateexternals() |
211
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
135 # paranoidly generate the list of files to commit |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
136 files_to_commit = set(self.current.files.keys()) |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
137 files_to_commit.update(self.current.symlinks.keys()) |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
138 files_to_commit.update(self.current.execfiles.keys()) |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
139 files_to_commit.update(self.current.deleted.keys()) |
211
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
140 # back to a list and sort so we get sane behavior |
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
141 files_to_commit = list(files_to_commit) |
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
142 files_to_commit.sort() |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
143 branch_batches = {} |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
144 rev = self.current.rev |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
145 date = self.meta.fixdate(rev.date) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
146 |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
147 # build up the branches that have files on them |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
148 for f in files_to_commit: |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
149 if not self.meta.is_path_valid(f): |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
150 continue |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
151 p, b = self.meta.split_branch_path(f)[:2] |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
152 if b not in branch_batches: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
153 branch_batches[b] = [] |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
154 branch_batches[b].append((p, f)) |
369
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
155 |
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
156 closebranches = {} |
367
ce64d57172a3
Generate separate data structure containing revision's tags/branches changes.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
365
diff
changeset
|
157 for branch in tbdelta['branches'][1]: |
415
b17b2969861c
svnmeta: move revmap methods, make last_known_revision() more efficient
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
414
diff
changeset
|
158 branchedits = self.meta.revmap.branchedits(branch, rev) |
147
22162380c4b9
Improve branch closing in the case of a single-rev replacement of one branch
Augie Fackler <durin42@gmail.com>
parents:
146
diff
changeset
|
159 if len(branchedits) < 1: |
22162380c4b9
Improve branch closing in the case of a single-rev replacement of one branch
Augie Fackler <durin42@gmail.com>
parents:
146
diff
changeset
|
160 # can't close a branch that never existed |
22162380c4b9
Improve branch closing in the case of a single-rev replacement of one branch
Augie Fackler <durin42@gmail.com>
parents:
146
diff
changeset
|
161 continue |
22162380c4b9
Improve branch closing in the case of a single-rev replacement of one branch
Augie Fackler <durin42@gmail.com>
parents:
146
diff
changeset
|
162 ha = branchedits[0][1] |
369
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
163 closebranches[branch] = ha |
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
164 |
370
c4da18ba92ea
Reorder different commit blocks.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
369
diff
changeset
|
165 # 1. handle normal commits |
369
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
166 closedrevs = closebranches.values() |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
167 for branch, files in branch_batches.iteritems(): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
168 if branch in self.current.emptybranches and files: |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
169 del self.current.emptybranches[branch] |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
170 files = dict(files) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
171 |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
172 parents = (self.meta.get_parent_revision(rev.revnum, branch), |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
173 revlog.nullid) |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
174 if parents[0] in closedrevs and branch in self.meta.closebranches: |
147
22162380c4b9
Improve branch closing in the case of a single-rev replacement of one branch
Augie Fackler <durin42@gmail.com>
parents:
146
diff
changeset
|
175 continue |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
176 extra = util.build_extra(rev.revnum, branch, self.meta.uuid, self.meta.subdir) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
177 if branch is not None: |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
178 if (branch not in self.meta.branches |
133
2242dd1163c6
hg_delta_editor: fix bad parent revision calculation in the case of a branch
Augie Fackler <durin42@gmail.com>
parents:
131
diff
changeset
|
179 and branch not in self.repo.branchtags()): |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
180 continue |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
181 parent_ctx = self.repo.changectx(parents[0]) |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
182 if '.hgsvnexternals' not in parent_ctx and '.hgsvnexternals' in files: |
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
183 # Do not register empty externals files |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
184 if (files['.hgsvnexternals'] in self.current.files |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
185 and not self.current.files[files['.hgsvnexternals']]): |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
186 del files['.hgsvnexternals'] |
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
187 |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
188 def filectxfn(repo, memctx, path): |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
189 current_file = files[path] |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
190 if current_file in self.current.deleted: |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
191 raise IOError() |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
192 copied = self.current.copies.get(current_file) |
55
987e44afa71e
hg_delta_editor: simplify exec/symlink flags generation
Patrick Mezard <pmezard@gmail.com>
parents:
43
diff
changeset
|
193 flags = parent_ctx.flags(path) |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
194 is_exec = self.current.execfiles.get(current_file, 'x' in flags) |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
195 is_link = self.current.symlinks.get(current_file, 'l' in flags) |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
196 if current_file in self.current.files: |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
197 data = self.current.files[current_file] |
335
9ef720a611e0
HgChangeReceiver: better diagnostics for invalid links
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
331
diff
changeset
|
198 if is_link and data.startswith('link '): |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
199 data = data[len('link '):] |
335
9ef720a611e0
HgChangeReceiver: better diagnostics for invalid links
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
331
diff
changeset
|
200 elif is_link: |
350
b6f9e270f103
hg_delta_editor: do not raise an error for bad symlinks, but warn instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
347
diff
changeset
|
201 self.ui.warn('file marked as link, but contains data: ' |
b6f9e270f103
hg_delta_editor: do not raise an error for bad symlinks, but warn instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
347
diff
changeset
|
202 '%s (%r)\n' % (current_file, flags)) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
203 else: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
204 data = parent_ctx.filectx(path).data() |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
205 return context.memfilectx(path=path, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
206 data=data, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
207 islink=is_link, isexec=is_exec, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
208 copied=copied) |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
209 if not self.meta.usebranchnames: |
321
b6c6d32c8ef1
Add an option to clone without branch names.
Augie Fackler <durin42@gmail.com>
parents:
317
diff
changeset
|
210 extra.pop('branch', None) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
211 current_ctx = context.memctx(self.repo, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
212 parents, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
213 rev.message or '...', |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
214 files.keys(), |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
215 filectxfn, |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
216 self.meta.authors[rev.author], |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
217 date, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
218 extra) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
219 new_hash = self.repo.commitctx(current_ctx) |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
220 util.describe_commit(self.ui, new_hash, branch) |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
221 if (rev.revnum, branch) not in self.meta.revmap: |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
222 self.meta.revmap[rev.revnum, branch] = new_hash |
369
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
223 |
370
c4da18ba92ea
Reorder different commit blocks.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
369
diff
changeset
|
224 # 2. handle branches that need to be committed without any files |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
225 for branch in self.current.emptybranches: |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
226 ha = self.meta.get_parent_revision(rev.revnum, branch) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
227 if ha == node.nullid: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
228 continue |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
229 parent_ctx = self.repo.changectx(ha) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
230 def del_all_files(*args): |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
231 raise IOError |
369
ce2b7ef74f89
Extract closed_revs into closebranches and closedrevs.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
368
diff
changeset
|
232 # True here meant nuke all files, shouldn't happen with branch closing |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
233 if self.current.emptybranches[branch]: #pragma: no cover |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
234 raise hgutil.Abort('Empty commit to an open branch attempted. ' |
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
235 'Please report this issue.') |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
236 extra = util.build_extra(rev.revnum, branch, self.meta.uuid, self.meta.subdir) |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
237 if not self.meta.usebranchnames: |
321
b6c6d32c8ef1
Add an option to clone without branch names.
Augie Fackler <durin42@gmail.com>
parents:
317
diff
changeset
|
238 extra.pop('branch', None) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
239 current_ctx = context.memctx(self.repo, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
240 (ha, node.nullid), |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
241 rev.message or ' ', |
136
cf6fe8457570
Fix an apparent regression where branch name didn't get properly stored for
Augie Fackler <durin42@gmail.com>
parents:
133
diff
changeset
|
242 [], |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
243 del_all_files, |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
244 self.meta.authors[rev.author], |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
245 date, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
246 extra) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
247 new_hash = self.repo.commitctx(current_ctx) |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
248 util.describe_commit(self.ui, new_hash, branch) |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
249 if (rev.revnum, branch) not in self.meta.revmap: |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
250 self.meta.revmap[rev.revnum, branch] = new_hash |
370
c4da18ba92ea
Reorder different commit blocks.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
369
diff
changeset
|
251 |
376
9327e9325645
Use tbdelta to push added tags into .hgtags.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
375
diff
changeset
|
252 # 3. handle tags |
9327e9325645
Use tbdelta to push added tags into .hgtags.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
375
diff
changeset
|
253 if tbdelta['tags'][0] or tbdelta['tags'][1]: |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
254 self.meta.committags(tbdelta['tags'], rev, closebranches) |
376
9327e9325645
Use tbdelta to push added tags into .hgtags.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
375
diff
changeset
|
255 |
9327e9325645
Use tbdelta to push added tags into .hgtags.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
375
diff
changeset
|
256 # 4. close any branches that need it |
400
09625f3abdb0
branches: simplify branch deletion a little bit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
399
diff
changeset
|
257 for branch, parent in closebranches.iteritems(): |
09625f3abdb0
branches: simplify branch deletion a little bit
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
399
diff
changeset
|
258 if parent is None: |
370
c4da18ba92ea
Reorder different commit blocks.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
369
diff
changeset
|
259 continue |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
260 self.meta.delbranch(branch, parent, rev) |
370
c4da18ba92ea
Reorder different commit blocks.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
369
diff
changeset
|
261 |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
262 self.current.clear() |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
263 |
364
b71c8f935740
Move HgChangeReceiver.aresamefiles() to before the editor methods.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
363
diff
changeset
|
264 # Here come all the actual editor methods |
b71c8f935740
Move HgChangeReceiver.aresamefiles() to before the editor methods.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
363
diff
changeset
|
265 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
266 @ieditor |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
267 def delete_entry(self, path, revision_bogus, parent_baton, pool=None): |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
268 br_path, branch = self.meta.split_branch_path(path)[:2] |
133
2242dd1163c6
hg_delta_editor: fix bad parent revision calculation in the case of a branch
Augie Fackler <durin42@gmail.com>
parents:
131
diff
changeset
|
269 if br_path == '': |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
270 self.meta.closebranches.add(branch) |
116
30580c05dccc
hg_delta_editor: merge _is_path_valid() and _path_and_branch_from_path()
Patrick Mezard <pmezard@gmail.com>
parents:
111
diff
changeset
|
271 if br_path is not None: |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
272 ha = self.meta.get_parent_revision(self.current.rev.revnum, branch) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
273 if ha == revlog.nullid: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
274 return |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
275 ctx = self.repo.changectx(ha) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
276 if br_path not in ctx: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
277 br_path2 = '' |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
278 if br_path != '': |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
279 br_path2 = br_path + '/' |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
280 # assuming it is a directory |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
281 self.current.externals[path] = None |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
282 map(self.delete_file, [pat for pat in self.current.files.iterkeys() |
232
c0063328587f
Fix and test for directory deletes during branch creation.
Augie Fackler <durin42@gmail.com>
parents:
228
diff
changeset
|
283 if pat.startswith(path+'/')]) |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
284 for f in ctx.walk(util.PrefixMatch(br_path2)): |
39
b3c7b844b782
Some more fixes of cases discovered in the melange repo. If anyone knows how I can reproduce a "replaced" state in Subversion, I'd love to be able to make a real test case for this code.
Augie Fackler <durin42@gmail.com>
parents:
38
diff
changeset
|
285 f_p = '%s/%s' % (path, f[len(br_path2):]) |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
286 if f_p not in self.current.files: |
145
b37c401b7f92
hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents:
141
diff
changeset
|
287 self.delete_file(f_p) |
b37c401b7f92
hg_delta_editor: reset properties of deleted entries
Patrick Mezard <pmezard@gmail.com>
parents:
141
diff
changeset
|
288 self.delete_file(path) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
289 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
290 @ieditor |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
291 def open_file(self, path, parent_baton, base_revision, p=None): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
292 self.current.file = None |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
293 fpath, branch = self.meta.split_branch_path(path)[:2] |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
294 if not fpath: |
322
05cd4a5138bf
Move some .warn() calls to noisy levels instead.
Augie Fackler <durin42@gmail.com>
parents:
321
diff
changeset
|
295 self.ui.debug('WARNING: Opening non-existant file %s\n' % path) |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
296 return |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
297 |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
298 self.current.file = path |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
299 self.ui.note('M %s\n' % path) |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
300 if base_revision != -1: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
301 self.current.base = base_revision |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
302 else: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
303 self.current.base = None |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
304 |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
305 if self.current.file in self.current.files: |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
306 return |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
307 |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
308 baserev = base_revision |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
309 if baserev is None or baserev == -1: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
310 baserev = self.current.rev.revnum - 1 |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
311 parent = self.meta.get_parent_revision(baserev + 1, branch) |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
312 |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
313 ctx = self.repo[parent] |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
314 if not self.meta.is_path_valid(path): |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
315 return |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
316 |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
317 if fpath not in ctx: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
318 self.current.missing.add(path) |
378
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
319 |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
320 fctx = ctx.filectx(fpath) |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
321 base = fctx.data() |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
322 if 'l' in fctx.flags(): |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
323 base = 'link ' + base |
eeefbe104087
Inline HgChangeReceiver.load_base_from_ctx().
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
377
diff
changeset
|
324 self.set_file(path, base, 'x' in fctx.flags(), 'l' in fctx.flags()) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
325 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
326 @ieditor |
300
4aba7542f6a9
Various cleanups, cosmetics and removal of superfluous assertions.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
299
diff
changeset
|
327 def add_file(self, path, parent_baton=None, copyfrom_path=None, |
4aba7542f6a9
Various cleanups, cosmetics and removal of superfluous assertions.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
299
diff
changeset
|
328 copyfrom_revision=None, file_pool=None): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
329 self.current.file = None |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
330 self.current.base = None |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
331 if path in self.current.deleted: |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
332 del self.current.deleted[path] |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
333 fpath, branch = self.meta.split_branch_path(path, existing=False)[:2] |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
334 if not fpath: |
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
335 return |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
336 if branch not in self.meta.branches: |
203
907c160c6289
Refactor branch handling to be much more dynamic (and hopefully robust).
Augie Fackler <durin42@gmail.com>
parents:
198
diff
changeset
|
337 # we know this branch will exist now, because it has at least one file. Rock. |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
338 self.meta.branches[branch] = None, 0, self.current.rev.revnum |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
339 self.current.file = path |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
340 if not copyfrom_path: |
186
6266ba36ee15
Create patch to make normal output much less verbose…
Dan Villiom Podlaski Christiansen <danchr@cs.au.dk>
parents:
181
diff
changeset
|
341 self.ui.note('A %s\n' % path) |
211
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
342 self.set_file(path, '', False, False) |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
343 return |
186
6266ba36ee15
Create patch to make normal output much less verbose…
Dan Villiom Podlaski Christiansen <danchr@cs.au.dk>
parents:
181
diff
changeset
|
344 self.ui.note('A+ %s\n' % path) |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
345 (from_file, |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
346 from_branch) = self.meta.split_branch_path(copyfrom_path)[:2] |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
347 if not from_file: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
348 self.current.missing.add(path) |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
349 return |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
350 ha = self.meta.get_parent_revision(copyfrom_revision + 1, |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
351 from_branch) |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
352 ctx = self.repo.changectx(ha) |
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
353 if from_file in ctx: |
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
354 fctx = ctx.filectx(from_file) |
97
0d3a2a7cefa3
hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
73
diff
changeset
|
355 flags = fctx.flags() |
211
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
356 self.set_file(path, fctx.data(), 'x' in flags, 'l' in flags) |
67
e319c9168910
hg_delta_editor: register svn file copies
Patrick Mezard <pmezard@gmail.com>
parents:
59
diff
changeset
|
357 if from_branch == branch: |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
358 parentid = self.meta.get_parent_revision(self.current.rev.revnum, |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
359 branch) |
69
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
360 if parentid != revlog.nullid: |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
361 parentctx = self.repo.changectx(parentid) |
410
eb524b957345
move aresamefiles() from HgChangeReceiver to util
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
409
diff
changeset
|
362 if util.aresamefiles(parentctx, ctx, [from_file]): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
363 self.current.copies[path] = from_file |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
364 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
365 @ieditor |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
366 def add_directory(self, path, parent_baton, copyfrom_path, |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
367 copyfrom_revision, dir_pool=None): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
368 self.current.batons[path] = path |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
369 br_path, branch = self.meta.split_branch_path(path)[:2] |
116
30580c05dccc
hg_delta_editor: merge _is_path_valid() and _path_and_branch_from_path()
Patrick Mezard <pmezard@gmail.com>
parents:
111
diff
changeset
|
370 if br_path is not None: |
30580c05dccc
hg_delta_editor: merge _is_path_valid() and _path_and_branch_from_path()
Patrick Mezard <pmezard@gmail.com>
parents:
111
diff
changeset
|
371 if not copyfrom_path and not br_path: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
372 self.current.emptybranches[branch] = True |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
373 else: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
374 self.current.emptybranches[branch] = False |
116
30580c05dccc
hg_delta_editor: merge _is_path_valid() and _path_and_branch_from_path()
Patrick Mezard <pmezard@gmail.com>
parents:
111
diff
changeset
|
375 if br_path is None or not copyfrom_path: |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
376 return path |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
55
diff
changeset
|
377 if copyfrom_path: |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
378 tag = self.meta.is_path_tag(copyfrom_path) |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
379 if tag not in self.meta.tags: |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
55
diff
changeset
|
380 tag = None |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
381 if not self.meta.is_path_valid(copyfrom_path) and not tag: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
382 self.current.missing.add('%s/' % path) |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
383 return path |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
55
diff
changeset
|
384 if tag: |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
385 source_branch, source_rev = self.meta.tags[tag] |
59
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
55
diff
changeset
|
386 cp_f = '' |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
55
diff
changeset
|
387 else: |
430af23bef4a
Performance fix for branches-from-tags in real replay, which is tied up with
Augie Fackler <durin42@gmail.com>
parents:
55
diff
changeset
|
388 source_rev = copyfrom_revision |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
389 cp_f, source_branch = self.meta.split_branch_path(copyfrom_path)[:2] |
203
907c160c6289
Refactor branch handling to be much more dynamic (and hopefully robust).
Augie Fackler <durin42@gmail.com>
parents:
198
diff
changeset
|
390 if cp_f == '' and br_path == '': |
217
6eb691a163cd
hg_delta_editor: stop using foobaz as a bogus filename.
Augie Fackler <durin42@gmail.com>
parents:
214
diff
changeset
|
391 assert br_path is not None |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
392 tmp = source_branch, source_rev, self.current.rev.revnum |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
393 self.meta.branches[branch] = tmp |
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
394 new_hash = self.meta.get_parent_revision(source_rev + 1, source_branch) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
395 if new_hash == node.nullid: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
396 self.current.missing.add('%s/' % path) |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
397 return path |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
398 cp_f_ctx = self.repo.changectx(new_hash) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
399 if cp_f != '/' and cp_f != '': |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
400 cp_f = '%s/' % cp_f |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
401 else: |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
402 cp_f = '' |
69
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
403 copies = {} |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
404 for f in cp_f_ctx: |
69
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
405 if not f.startswith(cp_f): |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
406 continue |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
407 f2 = f[len(cp_f):] |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
408 fctx = cp_f_ctx.filectx(f) |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
409 fp_c = path + '/' + f2 |
97
0d3a2a7cefa3
hg_delta_editor: fix symlink prefix confusion
Patrick Mezard <pmezard@gmail.com>
parents:
73
diff
changeset
|
410 self.set_file(fp_c, fctx.data(), 'x' in fctx.flags(), 'l' in fctx.flags()) |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
411 if fp_c in self.current.deleted: |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
412 del self.current.deleted[fp_c] |
69
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
413 if branch == source_branch: |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
414 copies[fp_c] = f |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
415 if copies: |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
416 # Preserve the directory copy records if no file was changed between |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
417 # the source and destination revisions, or discard it completely. |
414
343da842dbe6
split parts of HgChangeReceiver out into an SVNMeta class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
413
diff
changeset
|
418 parentid = self.meta.get_parent_revision(self.current.rev.revnum, branch) |
69
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
419 if parentid != revlog.nullid: |
63ece4ea25c9
hg_delta_editor: register copies only if files are unchanged between source and dest
Patrick Mezard <pmezard@gmail.com>
parents:
67
diff
changeset
|
420 parentctx = self.repo.changectx(parentid) |
410
eb524b957345
move aresamefiles() from HgChangeReceiver to util
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
409
diff
changeset
|
421 if util.aresamefiles(parentctx, cp_f_ctx, copies.values()): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
422 self.current.copies.update(copies) |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
423 return path |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
424 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
425 @ieditor |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
426 def change_file_prop(self, file_baton, name, value, pool=None): |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
427 if name == 'svn:executable': |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
428 self.current.execfiles[self.current.file] = bool(value is not None) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
429 elif name == 'svn:special': |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
430 self.current.symlinks[self.current.file] = bool(value is not None) |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
431 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
432 @ieditor |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
433 def change_dir_prop(self, dir_baton, name, value, pool=None): |
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
434 if dir_baton is None: |
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
435 return |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
436 path = self.current.batons[dir_baton] |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
437 if name == 'svn:externals': |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
438 self.current.externals[path] = value |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
439 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
440 @ieditor |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
441 def open_directory(self, path, parent_baton, base_revision, dir_pool=None): |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
442 self.current.batons[path] = path |
420
59e19c73b0df
svnmeta: eliminate unneeded path_and_branch_for_path() method
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
418
diff
changeset
|
443 p_, branch = self.meta.split_branch_path(path)[:2] |
116
30580c05dccc
hg_delta_editor: merge _is_path_valid() and _path_and_branch_from_path()
Patrick Mezard <pmezard@gmail.com>
parents:
111
diff
changeset
|
444 if p_ == '': |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
445 self.current.emptybranches[branch] = False |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
446 return path |
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
447 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
448 @ieditor |
174
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
449 def close_directory(self, dir_baton, dir_pool=None): |
f80132c5fea5
Convert svn:externals properties into a .hgsvnexternals file
Patrick Mezard <pmezard@gmail.com>
parents:
168
diff
changeset
|
450 if dir_baton is not None: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
451 del self.current.batons[dir_baton] |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
452 |
362
705f33c0a323
Replace stash_exception_on_self() by @ieditor.
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
352
diff
changeset
|
453 @ieditor |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
454 def apply_textdelta(self, file_baton, base_checksum, pool=None): |
211
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
455 # We know coming in here the file must be one of the following options: |
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
456 # 1) Deleted (invalid, fail an assertion) |
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
457 # 2) Missing a base text (bail quick since we have to fetch a full plaintext) |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
458 # 3) Has a base text in self.current.files, apply deltas |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
459 base = '' |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
460 if not self.meta.is_path_valid(self.current.file): |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
461 return lambda x: None |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
462 assert self.current.file not in self.current.deleted, ( |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
463 'Cannot apply_textdelta to a deleted file: %s' % self.current.file) |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
464 assert (self.current.file in self.current.files |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
465 or self.current.file in self.current.missing), '%s not found' % self.current.file |
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
466 if self.current.file in self.current.missing: |
211
05243ec295e1
fetch: Fix a bug that caused plaintexts to be interpreted as missing more often than they should be.
Augie Fackler <durin42@gmail.com>
parents:
207
diff
changeset
|
467 return lambda x: None |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
468 base = self.current.files[self.current.file] |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
469 source = cStringIO.StringIO(base) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
470 target = cStringIO.StringIO() |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
471 self.stream = target |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
472 |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
473 handler, baton = delta.svn_txdelta_apply(source, target, None) |
146
4da9f20aef01
Add some more coverage directives.
Augie Fackler <durin42@gmail.com>
parents:
145
diff
changeset
|
474 if not callable(handler): #pragma: no cover |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
475 raise hgutil.Abort('Error in Subversion bindings: ' |
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
476 'cannot call handler!') |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
477 def txdelt_window(window): |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
478 try: |
417
8630d1ebcdb9
svnmeta: deprivatize a bunch of member functions
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
416
diff
changeset
|
479 if not self.meta.is_path_valid(self.current.file): |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
480 return |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
481 handler(window, baton) |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
482 # window being None means commit this file |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
483 if not window: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
484 self.current.files[self.current.file] = target.getvalue() |
146
4da9f20aef01
Add some more coverage directives.
Augie Fackler <durin42@gmail.com>
parents:
145
diff
changeset
|
485 except core.SubversionException, e: #pragma: no cover |
224
2165461d2dd8
Exception clean-ups; use symbolic names & avoid Python 2.6 deprecations.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
211
diff
changeset
|
486 if e.apr_err == core.SVN_ERR_INCOMPLETE_DATA: |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
487 self.current.missing.add(self.current.file) |
146
4da9f20aef01
Add some more coverage directives.
Augie Fackler <durin42@gmail.com>
parents:
145
diff
changeset
|
488 else: #pragma: no cover |
250
79349fd04836
utils: standardizing imported name to hgutil, our_util to util
Daniel Tang <dytang@cs.purdue.edu>
parents:
237
diff
changeset
|
489 raise hgutil.Abort(*e.args) |
146
4da9f20aef01
Add some more coverage directives.
Augie Fackler <durin42@gmail.com>
parents:
145
diff
changeset
|
490 except: #pragma: no cover |
411
d71972428fce
editor: move current revision state into a separate class
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
410
diff
changeset
|
491 print len(base), self.current.file |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
492 self._exception_info = sys.exc_info() |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
493 raise |
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
494 return txdelt_window |