Show More
@@ -49,3 +49,4 b' 195dbd1cef0c2f9f8bcf4ea303238105f716bda3' | |||||
49 | 6344043924497cd06d781d9014c66802285072e4 0 iD8DBQBPALgmywK+sNU5EO8RAlfhAJ9nYOdWnhfVDHYtDTJAyJtXBAQS9wCgnefoSQt7QABkbGxM+Q85UYEBuD0= |
|
49 | 6344043924497cd06d781d9014c66802285072e4 0 iD8DBQBPALgmywK+sNU5EO8RAlfhAJ9nYOdWnhfVDHYtDTJAyJtXBAQS9wCgnefoSQt7QABkbGxM+Q85UYEBuD0= | |
50 | db33555eafeaf9df1e18950e29439eaa706d399b 0 iD8DBQBPGdzxywK+sNU5EO8RAppkAJ9jOXhUVE/97CPgiMA0pMGiIYnesQCfengAszcBiSiKGugiI8Okc9ghU+Y= |
|
50 | db33555eafeaf9df1e18950e29439eaa706d399b 0 iD8DBQBPGdzxywK+sNU5EO8RAppkAJ9jOXhUVE/97CPgiMA0pMGiIYnesQCfengAszcBiSiKGugiI8Okc9ghU+Y= | |
51 | 2aa5b51f310fb3befd26bed99c02267f5c12c734 0 iD8DBQBPKZ9bywK+sNU5EO8RAt1TAJ45r1eJ0YqSkInzrrayg4TVCh0SnQCgm0GA/Ua74jnnDwVQ60lAwROuz1Q= |
|
51 | 2aa5b51f310fb3befd26bed99c02267f5c12c734 0 iD8DBQBPKZ9bywK+sNU5EO8RAt1TAJ45r1eJ0YqSkInzrrayg4TVCh0SnQCgm0GA/Ua74jnnDwVQ60lAwROuz1Q= | |
|
52 | 53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 0 iD8DBQBPT/fvywK+sNU5EO8RAnfYAKCn7d0vwqIb100YfWm1F7nFD5B+FACeM02YHpQLSNsztrBCObtqcnfod7Q= |
@@ -61,3 +61,4 b' 195dbd1cef0c2f9f8bcf4ea303238105f716bda3' | |||||
61 | 6344043924497cd06d781d9014c66802285072e4 2.0.2 |
|
61 | 6344043924497cd06d781d9014c66802285072e4 2.0.2 | |
62 | db33555eafeaf9df1e18950e29439eaa706d399b 2.1-rc |
|
62 | db33555eafeaf9df1e18950e29439eaa706d399b 2.1-rc | |
63 | 2aa5b51f310fb3befd26bed99c02267f5c12c734 2.1 |
|
63 | 2aa5b51f310fb3befd26bed99c02267f5c12c734 2.1 | |
|
64 | 53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 2.1.1 |
@@ -497,6 +497,7 b' class cookietransportrequest(object):' | |||||
497 |
|
497 | |||
498 | def request(self, host, handler, request_body, verbose=0): |
|
498 | def request(self, host, handler, request_body, verbose=0): | |
499 | self.verbose = verbose |
|
499 | self.verbose = verbose | |
|
500 | self.accept_gzip_encoding = False | |||
500 |
|
501 | |||
501 | # issue XML-RPC request |
|
502 | # issue XML-RPC request | |
502 | h = self.make_connection(host) |
|
503 | h = self.make_connection(host) |
@@ -129,6 +129,7 b' def setcurrent(repo, mark):' | |||||
129 | def unsetcurrent(repo): |
|
129 | def unsetcurrent(repo): | |
130 | wlock = repo.wlock() |
|
130 | wlock = repo.wlock() | |
131 | try: |
|
131 | try: | |
|
132 | try: | |||
132 | util.unlink(repo.join('bookmarks.current')) |
|
133 | util.unlink(repo.join('bookmarks.current')) | |
133 | repo._bookmarkcurrent = None |
|
134 | repo._bookmarkcurrent = None | |
134 | except OSError, inst: |
|
135 | except OSError, inst: |
@@ -168,6 +168,7 b' class bundlerepository(localrepo.localre' | |||||
168 | self._tempparent = tempfile.mkdtemp() |
|
168 | self._tempparent = tempfile.mkdtemp() | |
169 | localrepo.instance(ui, self._tempparent, 1) |
|
169 | localrepo.instance(ui, self._tempparent, 1) | |
170 | localrepo.localrepository.__init__(self, ui, self._tempparent) |
|
170 | localrepo.localrepository.__init__(self, ui, self._tempparent) | |
|
171 | self.ui.setconfig('phases', 'publish', False) | |||
171 |
|
172 | |||
172 | if path: |
|
173 | if path: | |
173 | self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename |
|
174 | self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename |
@@ -14,6 +14,17 b' import cStringIO' | |||||
14 |
|
14 | |||
15 | _format = ">cllll" |
|
15 | _format = ">cllll" | |
16 | propertycache = util.propertycache |
|
16 | propertycache = util.propertycache | |
|
17 | filecache = scmutil.filecache | |||
|
18 | ||||
|
19 | class repocache(filecache): | |||
|
20 | """filecache for files in .hg/""" | |||
|
21 | def join(self, obj, fname): | |||
|
22 | return obj._opener.join(fname) | |||
|
23 | ||||
|
24 | class rootcache(filecache): | |||
|
25 | """filecache for files in the repository root""" | |||
|
26 | def join(self, obj, fname): | |||
|
27 | return obj._join(fname) | |||
17 |
|
28 | |||
18 | def _finddirs(path): |
|
29 | def _finddirs(path): | |
19 | pos = path.rfind('/') |
|
30 | pos = path.rfind('/') | |
@@ -52,6 +63,7 b' class dirstate(object):' | |||||
52 | self._dirtypl = False |
|
63 | self._dirtypl = False | |
53 | self._lastnormaltime = 0 |
|
64 | self._lastnormaltime = 0 | |
54 | self._ui = ui |
|
65 | self._ui = ui | |
|
66 | self._filecache = {} | |||
55 |
|
67 | |||
56 | @propertycache |
|
68 | @propertycache | |
57 | def _map(self): |
|
69 | def _map(self): | |
@@ -77,7 +89,7 b' class dirstate(object):' | |||||
77 | f['.'] = '.' # prevents useless util.fspath() invocation |
|
89 | f['.'] = '.' # prevents useless util.fspath() invocation | |
78 | return f |
|
90 | return f | |
79 |
|
91 | |||
80 | @propertycache |
|
92 | @repocache('branch') | |
81 | def _branch(self): |
|
93 | def _branch(self): | |
82 | try: |
|
94 | try: | |
83 | return self._opener.read("branch").strip() or "default" |
|
95 | return self._opener.read("branch").strip() or "default" | |
@@ -113,7 +125,7 b' class dirstate(object):' | |||||
113 | def dirs(self): |
|
125 | def dirs(self): | |
114 | return self._dirs |
|
126 | return self._dirs | |
115 |
|
127 | |||
116 | @propertycache |
|
128 | @rootcache('.hgignore') | |
117 | def _ignore(self): |
|
129 | def _ignore(self): | |
118 | files = [self._join('.hgignore')] |
|
130 | files = [self._join('.hgignore')] | |
119 | for name, path in self._ui.configitems("ui"): |
|
131 | for name, path in self._ui.configitems("ui"): |
@@ -220,6 +220,8 b' def filemerge(repo, mynode, orig, fcd, f' | |||||
220 | util.copyfile(a, a + ".local") |
|
220 | util.copyfile(a, a + ".local") | |
221 | repo.wwrite(fd + ".other", fco.data(), fco.flags()) |
|
221 | repo.wwrite(fd + ".other", fco.data(), fco.flags()) | |
222 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) |
|
222 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) | |
|
223 | os.unlink(b) | |||
|
224 | os.unlink(c) | |||
223 | return 1 # unresolved |
|
225 | return 1 # unresolved | |
224 | else: |
|
226 | else: | |
225 | args = _toolstr(ui, tool, "args", '$local $base $other') |
|
227 | args = _toolstr(ui, tool, "args", '$local $base $other') |
@@ -19,6 +19,11 b' import weakref, errno, os, time, inspect' | |||||
19 | propertycache = util.propertycache |
|
19 | propertycache = util.propertycache | |
20 | filecache = scmutil.filecache |
|
20 | filecache = scmutil.filecache | |
21 |
|
21 | |||
|
22 | class storecache(filecache): | |||
|
23 | """filecache for files in the store""" | |||
|
24 | def join(self, obj, fname): | |||
|
25 | return obj.sjoin(fname) | |||
|
26 | ||||
22 | class localrepository(repo.repository): |
|
27 | class localrepository(repo.repository): | |
23 | capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey', |
|
28 | capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey', | |
24 | 'known', 'getbundle')) |
|
29 | 'known', 'getbundle')) | |
@@ -176,7 +181,7 b' class localrepository(repo.repository):' | |||||
176 | def _writebookmarks(self, marks): |
|
181 | def _writebookmarks(self, marks): | |
177 | bookmarks.write(self) |
|
182 | bookmarks.write(self) | |
178 |
|
183 | |||
179 |
@ |
|
184 | @storecache('phaseroots') | |
180 | def _phaseroots(self): |
|
185 | def _phaseroots(self): | |
181 | self._dirtyphases = False |
|
186 | self._dirtyphases = False | |
182 | phaseroots = phases.readroots(self) |
|
187 | phaseroots = phases.readroots(self) | |
@@ -195,7 +200,7 b' class localrepository(repo.repository):' | |||||
195 | cache[rev] = phase |
|
200 | cache[rev] = phase | |
196 | return cache |
|
201 | return cache | |
197 |
|
202 | |||
198 |
@ |
|
203 | @storecache('00changelog.i') | |
199 | def changelog(self): |
|
204 | def changelog(self): | |
200 | c = changelog.changelog(self.sopener) |
|
205 | c = changelog.changelog(self.sopener) | |
201 | if 'HG_PENDING' in os.environ: |
|
206 | if 'HG_PENDING' in os.environ: | |
@@ -204,7 +209,7 b' class localrepository(repo.repository):' | |||||
204 | c.readpending('00changelog.i.a') |
|
209 | c.readpending('00changelog.i.a') | |
205 | return c |
|
210 | return c | |
206 |
|
211 | |||
207 |
@ |
|
212 | @storecache('00manifest.i') | |
208 | def manifest(self): |
|
213 | def manifest(self): | |
209 | return manifest.manifest(self.sopener) |
|
214 | return manifest.manifest(self.sopener) | |
210 |
|
215 | |||
@@ -896,10 +901,13 b' class localrepository(repo.repository):' | |||||
896 | rereads the dirstate. Use dirstate.invalidate() if you want to |
|
901 | rereads the dirstate. Use dirstate.invalidate() if you want to | |
897 | explicitly read the dirstate again (i.e. restoring it to a previous |
|
902 | explicitly read the dirstate again (i.e. restoring it to a previous | |
898 | known good state).''' |
|
903 | known good state).''' | |
|
904 | if 'dirstate' in self.__dict__: | |||
|
905 | for k in self.dirstate._filecache: | |||
899 | try: |
|
906 | try: | |
900 |
delattr(self, |
|
907 | delattr(self.dirstate, k) | |
901 | except AttributeError: |
|
908 | except AttributeError: | |
902 | pass |
|
909 | pass | |
|
910 | delattr(self, 'dirstate') | |||
903 |
|
911 | |||
904 | def invalidate(self): |
|
912 | def invalidate(self): | |
905 | for k in self._filecache: |
|
913 | for k in self._filecache: |
@@ -211,7 +211,7 b' class opener(abstractopener):' | |||||
211 | if r: |
|
211 | if r: | |
212 | raise util.Abort("%s: %r" % (r, path)) |
|
212 | raise util.Abort("%s: %r" % (r, path)) | |
213 | self.auditor(path) |
|
213 | self.auditor(path) | |
214 |
f = |
|
214 | f = self.join(path) | |
215 |
|
215 | |||
216 | if not text and "b" not in mode: |
|
216 | if not text and "b" not in mode: | |
217 | mode += "b" # for that other OS |
|
217 | mode += "b" # for that other OS | |
@@ -255,7 +255,7 b' class opener(abstractopener):' | |||||
255 |
|
255 | |||
256 | def symlink(self, src, dst): |
|
256 | def symlink(self, src, dst): | |
257 | self.auditor(dst) |
|
257 | self.auditor(dst) | |
258 |
linkname = |
|
258 | linkname = self.join(dst) | |
259 | try: |
|
259 | try: | |
260 | os.unlink(linkname) |
|
260 | os.unlink(linkname) | |
261 | except OSError: |
|
261 | except OSError: | |
@@ -280,6 +280,9 b' class opener(abstractopener):' | |||||
280 | def audit(self, path): |
|
280 | def audit(self, path): | |
281 | self.auditor(path) |
|
281 | self.auditor(path) | |
282 |
|
282 | |||
|
283 | def join(self, path): | |||
|
284 | return os.path.join(self.base, path) | |||
|
285 | ||||
283 | class filteropener(abstractopener): |
|
286 | class filteropener(abstractopener): | |
284 | '''Wrapper opener for filtering filenames with a function.''' |
|
287 | '''Wrapper opener for filtering filenames with a function.''' | |
285 |
|
288 | |||
@@ -793,9 +796,17 b' class filecache(object):' | |||||
793 | to tell us if a file has been replaced. If it can't, we fallback to |
|
796 | to tell us if a file has been replaced. If it can't, we fallback to | |
794 | recreating the object on every call (essentially the same behaviour as |
|
797 | recreating the object on every call (essentially the same behaviour as | |
795 | propertycache).''' |
|
798 | propertycache).''' | |
796 |
def __init__(self, path |
|
799 | def __init__(self, path): | |
797 | self.path = path |
|
800 | self.path = path | |
798 | self.instore = instore |
|
801 | ||
|
802 | def join(self, obj, fname): | |||
|
803 | """Used to compute the runtime path of the cached file. | |||
|
804 | ||||
|
805 | Users should subclass filecache and provide their own version of this | |||
|
806 | function to call the appropriate join function on 'obj' (an instance | |||
|
807 | of the class that its member function was decorated). | |||
|
808 | """ | |||
|
809 | return obj.join(fname) | |||
799 |
|
810 | |||
800 | def __call__(self, func): |
|
811 | def __call__(self, func): | |
801 | self.func = func |
|
812 | self.func = func | |
@@ -813,7 +824,7 b' class filecache(object):' | |||||
813 | if entry.changed(): |
|
824 | if entry.changed(): | |
814 | entry.obj = self.func(obj) |
|
825 | entry.obj = self.func(obj) | |
815 | else: |
|
826 | else: | |
816 |
path = self. |
|
827 | path = self.join(obj, self.path) | |
817 |
|
828 | |||
818 | # We stat -before- creating the object so our cache doesn't lie if |
|
829 | # We stat -before- creating the object so our cache doesn't lie if | |
819 | # a writer modified between the time we read and stat |
|
830 | # a writer modified between the time we read and stat |
@@ -500,7 +500,7 b' class hgsubrepo(abstractsubrepo):' | |||||
500 | anc = dst.ancestor(cur) |
|
500 | anc = dst.ancestor(cur) | |
501 |
|
501 | |||
502 | def mergefunc(): |
|
502 | def mergefunc(): | |
503 | if anc == cur: |
|
503 | if anc == cur and dst.branch() == cur.branch(): | |
504 | self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self)) |
|
504 | self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self)) | |
505 | hg.update(self._repo, state[1]) |
|
505 | hg.update(self._repo, state[1]) | |
506 | elif anc == dst: |
|
506 | elif anc == dst: |
@@ -454,7 +454,7 b" if sys.platform == 'darwin' and os.path." | |||||
454 | # distutils.sysconfig |
|
454 | # distutils.sysconfig | |
455 | version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines() |
|
455 | version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines() | |
456 | if version: |
|
456 | if version: | |
457 |
version = version |
|
457 | version = version[0] | |
458 | xcode4 = (version.startswith('Xcode') and |
|
458 | xcode4 = (version.startswith('Xcode') and | |
459 | StrictVersion(version.split()[1]) >= StrictVersion('4.0')) |
|
459 | StrictVersion(version.split()[1]) >= StrictVersion('4.0')) | |
460 | else: |
|
460 | else: |
@@ -212,6 +212,27 b' def rollback(server):' | |||||
212 | runcommand(server, ['rollback']) |
|
212 | runcommand(server, ['rollback']) | |
213 | runcommand(server, ['phase', '-r', '.']) |
|
213 | runcommand(server, ['phase', '-r', '.']) | |
214 |
|
214 | |||
|
215 | def branch(server): | |||
|
216 | readchannel(server) | |||
|
217 | runcommand(server, ['branch']) | |||
|
218 | os.system('hg branch foo') | |||
|
219 | runcommand(server, ['branch']) | |||
|
220 | os.system('hg branch default') | |||
|
221 | ||||
|
222 | def hgignore(server): | |||
|
223 | readchannel(server) | |||
|
224 | f = open('.hgignore', 'ab') | |||
|
225 | f.write('') | |||
|
226 | f.close() | |||
|
227 | runcommand(server, ['commit', '-Am.']) | |||
|
228 | f = open('ignored-file', 'ab') | |||
|
229 | f.write('') | |||
|
230 | f.close() | |||
|
231 | f = open('.hgignore', 'ab') | |||
|
232 | f.write('ignored-file') | |||
|
233 | f.close() | |||
|
234 | runcommand(server, ['status', '-i', '-u']) | |||
|
235 | ||||
215 | if __name__ == '__main__': |
|
236 | if __name__ == '__main__': | |
216 | os.system('hg init') |
|
237 | os.system('hg init') | |
217 |
|
238 | |||
@@ -232,3 +253,5 b" if __name__ == '__main__':" | |||||
232 | check(tagscache) |
|
253 | check(tagscache) | |
233 | check(setphase) |
|
254 | check(setphase) | |
234 | check(rollback) |
|
255 | check(rollback) | |
|
256 | check(branch) | |||
|
257 | check(hgignore) |
@@ -145,3 +145,21 b' repository tip rolled back to revision 3' | |||||
145 | working directory now based on revision 3 |
|
145 | working directory now based on revision 3 | |
146 | runcommand phase -r . |
|
146 | runcommand phase -r . | |
147 | 3: public |
|
147 | 3: public | |
|
148 | ||||
|
149 | testing branch: | |||
|
150 | ||||
|
151 | runcommand branch | |||
|
152 | default | |||
|
153 | marked working directory as branch foo | |||
|
154 | (branches are permanent and global, did you want a bookmark?) | |||
|
155 | runcommand branch | |||
|
156 | foo | |||
|
157 | marked working directory as branch default | |||
|
158 | (branches are permanent and global, did you want a bookmark?) | |||
|
159 | ||||
|
160 | testing hgignore: | |||
|
161 | ||||
|
162 | runcommand commit -Am. | |||
|
163 | adding .hgignore | |||
|
164 | runcommand status -i -u | |||
|
165 | I ignored-file |
@@ -465,6 +465,38 b' initial setup' | |||||
465 | o 0 public a-A - 054250a37db4 |
|
465 | o 0 public a-A - 054250a37db4 | |
466 |
|
466 | |||
467 |
|
467 | |||
|
468 | Pulling from bundle does not alter phases of changeset not present in the bundle | |||
|
469 | ||||
|
470 | $ hg bundle --base 1 -r 6 -r 3 ../partial-bundle.hg | |||
|
471 | 5 changesets found | |||
|
472 | $ hg pull ../partial-bundle.hg | |||
|
473 | pulling from ../partial-bundle.hg | |||
|
474 | searching for changes | |||
|
475 | no changes found | |||
|
476 | $ hgph | |||
|
477 | @ 10 draft a-H - 967b449fbc94 | |||
|
478 | | | |||
|
479 | | o 9 draft a-G - 3e27b6f1eee1 | |||
|
480 | | | | |||
|
481 | | o 8 draft a-F - b740e3e5c05d | |||
|
482 | | | | |||
|
483 | | o 7 draft a-E - e9f537e46dea | |||
|
484 | | | | |||
|
485 | +---o 6 public n-B - 145e75495359 | |||
|
486 | | | | |||
|
487 | o | 5 public n-A - d6bcb4f74035 | |||
|
488 | | | | |||
|
489 | o | 4 public b-A - f54f1bb90ff3 | |||
|
490 | | | | |||
|
491 | | o 3 public a-D - b555f63b6063 | |||
|
492 | | | | |||
|
493 | | o 2 public a-C - 54acac6f23ab | |||
|
494 | |/ | |||
|
495 | o 1 public a-B - 548a3d25dbf0 | |||
|
496 | | | |||
|
497 | o 0 public a-A - 054250a37db4 | |||
|
498 | ||||
|
499 | ||||
468 | Pushing to Publish=False (unknown changeset) |
|
500 | Pushing to Publish=False (unknown changeset) | |
469 |
|
501 | |||
470 | $ hg push ../mu -r b740e3e5c05d # a-F |
|
502 | $ hg push ../mu -r b740e3e5c05d # a-F |
General Comments 0
You need to be logged in to leave comments.
Login now