Show More
@@ -49,3 +49,4 b' 195dbd1cef0c2f9f8bcf4ea303238105f716bda3' | |||
|
49 | 49 | 6344043924497cd06d781d9014c66802285072e4 0 iD8DBQBPALgmywK+sNU5EO8RAlfhAJ9nYOdWnhfVDHYtDTJAyJtXBAQS9wCgnefoSQt7QABkbGxM+Q85UYEBuD0= |
|
50 | 50 | db33555eafeaf9df1e18950e29439eaa706d399b 0 iD8DBQBPGdzxywK+sNU5EO8RAppkAJ9jOXhUVE/97CPgiMA0pMGiIYnesQCfengAszcBiSiKGugiI8Okc9ghU+Y= |
|
51 | 51 | 2aa5b51f310fb3befd26bed99c02267f5c12c734 0 iD8DBQBPKZ9bywK+sNU5EO8RAt1TAJ45r1eJ0YqSkInzrrayg4TVCh0SnQCgm0GA/Ua74jnnDwVQ60lAwROuz1Q= |
|
52 | 53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 0 iD8DBQBPT/fvywK+sNU5EO8RAnfYAKCn7d0vwqIb100YfWm1F7nFD5B+FACeM02YHpQLSNsztrBCObtqcnfod7Q= |
@@ -61,3 +61,4 b' 195dbd1cef0c2f9f8bcf4ea303238105f716bda3' | |||
|
61 | 61 | 6344043924497cd06d781d9014c66802285072e4 2.0.2 |
|
62 | 62 | db33555eafeaf9df1e18950e29439eaa706d399b 2.1-rc |
|
63 | 63 | 2aa5b51f310fb3befd26bed99c02267f5c12c734 2.1 |
|
64 | 53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 2.1.1 |
@@ -497,6 +497,7 b' class cookietransportrequest(object):' | |||
|
497 | 497 | |
|
498 | 498 | def request(self, host, handler, request_body, verbose=0): |
|
499 | 499 | self.verbose = verbose |
|
500 | self.accept_gzip_encoding = False | |
|
500 | 501 | |
|
501 | 502 | # issue XML-RPC request |
|
502 | 503 | h = self.make_connection(host) |
@@ -129,6 +129,7 b' def setcurrent(repo, mark):' | |||
|
129 | 129 | def unsetcurrent(repo): |
|
130 | 130 | wlock = repo.wlock() |
|
131 | 131 | try: |
|
132 | try: | |
|
132 | 133 | util.unlink(repo.join('bookmarks.current')) |
|
133 | 134 | repo._bookmarkcurrent = None |
|
134 | 135 | except OSError, inst: |
@@ -168,6 +168,7 b' class bundlerepository(localrepo.localre' | |||
|
168 | 168 | self._tempparent = tempfile.mkdtemp() |
|
169 | 169 | localrepo.instance(ui, self._tempparent, 1) |
|
170 | 170 | localrepo.localrepository.__init__(self, ui, self._tempparent) |
|
171 | self.ui.setconfig('phases', 'publish', False) | |
|
171 | 172 | |
|
172 | 173 | if path: |
|
173 | 174 | self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename |
@@ -14,6 +14,17 b' import cStringIO' | |||
|
14 | 14 | |
|
15 | 15 | _format = ">cllll" |
|
16 | 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 | 29 | def _finddirs(path): |
|
19 | 30 | pos = path.rfind('/') |
@@ -52,6 +63,7 b' class dirstate(object):' | |||
|
52 | 63 | self._dirtypl = False |
|
53 | 64 | self._lastnormaltime = 0 |
|
54 | 65 | self._ui = ui |
|
66 | self._filecache = {} | |
|
55 | 67 | |
|
56 | 68 | @propertycache |
|
57 | 69 | def _map(self): |
@@ -77,7 +89,7 b' class dirstate(object):' | |||
|
77 | 89 | f['.'] = '.' # prevents useless util.fspath() invocation |
|
78 | 90 | return f |
|
79 | 91 | |
|
80 | @propertycache | |
|
92 | @repocache('branch') | |
|
81 | 93 | def _branch(self): |
|
82 | 94 | try: |
|
83 | 95 | return self._opener.read("branch").strip() or "default" |
@@ -113,7 +125,7 b' class dirstate(object):' | |||
|
113 | 125 | def dirs(self): |
|
114 | 126 | return self._dirs |
|
115 | 127 | |
|
116 | @propertycache | |
|
128 | @rootcache('.hgignore') | |
|
117 | 129 | def _ignore(self): |
|
118 | 130 | files = [self._join('.hgignore')] |
|
119 | 131 | for name, path in self._ui.configitems("ui"): |
@@ -220,6 +220,8 b' def filemerge(repo, mynode, orig, fcd, f' | |||
|
220 | 220 | util.copyfile(a, a + ".local") |
|
221 | 221 | repo.wwrite(fd + ".other", fco.data(), fco.flags()) |
|
222 | 222 | repo.wwrite(fd + ".base", fca.data(), fca.flags()) |
|
223 | os.unlink(b) | |
|
224 | os.unlink(c) | |
|
223 | 225 | return 1 # unresolved |
|
224 | 226 | else: |
|
225 | 227 | args = _toolstr(ui, tool, "args", '$local $base $other') |
@@ -19,6 +19,11 b' import weakref, errno, os, time, inspect' | |||
|
19 | 19 | propertycache = util.propertycache |
|
20 | 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 | 27 | class localrepository(repo.repository): |
|
23 | 28 | capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey', |
|
24 | 29 | 'known', 'getbundle')) |
@@ -176,7 +181,7 b' class localrepository(repo.repository):' | |||
|
176 | 181 | def _writebookmarks(self, marks): |
|
177 | 182 | bookmarks.write(self) |
|
178 | 183 | |
|
179 |
@ |
|
|
184 | @storecache('phaseroots') | |
|
180 | 185 | def _phaseroots(self): |
|
181 | 186 | self._dirtyphases = False |
|
182 | 187 | phaseroots = phases.readroots(self) |
@@ -195,7 +200,7 b' class localrepository(repo.repository):' | |||
|
195 | 200 | cache[rev] = phase |
|
196 | 201 | return cache |
|
197 | 202 | |
|
198 |
@ |
|
|
203 | @storecache('00changelog.i') | |
|
199 | 204 | def changelog(self): |
|
200 | 205 | c = changelog.changelog(self.sopener) |
|
201 | 206 | if 'HG_PENDING' in os.environ: |
@@ -204,7 +209,7 b' class localrepository(repo.repository):' | |||
|
204 | 209 | c.readpending('00changelog.i.a') |
|
205 | 210 | return c |
|
206 | 211 | |
|
207 |
@ |
|
|
212 | @storecache('00manifest.i') | |
|
208 | 213 | def manifest(self): |
|
209 | 214 | return manifest.manifest(self.sopener) |
|
210 | 215 | |
@@ -896,10 +901,13 b' class localrepository(repo.repository):' | |||
|
896 | 901 | rereads the dirstate. Use dirstate.invalidate() if you want to |
|
897 | 902 | explicitly read the dirstate again (i.e. restoring it to a previous |
|
898 | 903 | known good state).''' |
|
904 | if 'dirstate' in self.__dict__: | |
|
905 | for k in self.dirstate._filecache: | |
|
899 | 906 | try: |
|
900 |
delattr(self, |
|
|
907 | delattr(self.dirstate, k) | |
|
901 | 908 | except AttributeError: |
|
902 | 909 | pass |
|
910 | delattr(self, 'dirstate') | |
|
903 | 911 | |
|
904 | 912 | def invalidate(self): |
|
905 | 913 | for k in self._filecache: |
@@ -211,7 +211,7 b' class opener(abstractopener):' | |||
|
211 | 211 | if r: |
|
212 | 212 | raise util.Abort("%s: %r" % (r, path)) |
|
213 | 213 | self.auditor(path) |
|
214 |
f = |
|
|
214 | f = self.join(path) | |
|
215 | 215 | |
|
216 | 216 | if not text and "b" not in mode: |
|
217 | 217 | mode += "b" # for that other OS |
@@ -255,7 +255,7 b' class opener(abstractopener):' | |||
|
255 | 255 | |
|
256 | 256 | def symlink(self, src, dst): |
|
257 | 257 | self.auditor(dst) |
|
258 |
linkname = |
|
|
258 | linkname = self.join(dst) | |
|
259 | 259 | try: |
|
260 | 260 | os.unlink(linkname) |
|
261 | 261 | except OSError: |
@@ -280,6 +280,9 b' class opener(abstractopener):' | |||
|
280 | 280 | def audit(self, path): |
|
281 | 281 | self.auditor(path) |
|
282 | 282 | |
|
283 | def join(self, path): | |
|
284 | return os.path.join(self.base, path) | |
|
285 | ||
|
283 | 286 | class filteropener(abstractopener): |
|
284 | 287 | '''Wrapper opener for filtering filenames with a function.''' |
|
285 | 288 | |
@@ -793,9 +796,17 b' class filecache(object):' | |||
|
793 | 796 | to tell us if a file has been replaced. If it can't, we fallback to |
|
794 | 797 | recreating the object on every call (essentially the same behaviour as |
|
795 | 798 | propertycache).''' |
|
796 |
def __init__(self, path |
|
|
799 | def __init__(self, path): | |
|
797 | 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 | 811 | def __call__(self, func): |
|
801 | 812 | self.func = func |
@@ -813,7 +824,7 b' class filecache(object):' | |||
|
813 | 824 | if entry.changed(): |
|
814 | 825 | entry.obj = self.func(obj) |
|
815 | 826 | else: |
|
816 |
path = self. |
|
|
827 | path = self.join(obj, self.path) | |
|
817 | 828 | |
|
818 | 829 | # We stat -before- creating the object so our cache doesn't lie if |
|
819 | 830 | # a writer modified between the time we read and stat |
@@ -500,7 +500,7 b' class hgsubrepo(abstractsubrepo):' | |||
|
500 | 500 | anc = dst.ancestor(cur) |
|
501 | 501 | |
|
502 | 502 | def mergefunc(): |
|
503 | if anc == cur: | |
|
503 | if anc == cur and dst.branch() == cur.branch(): | |
|
504 | 504 | self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self)) |
|
505 | 505 | hg.update(self._repo, state[1]) |
|
506 | 506 | elif anc == dst: |
@@ -454,7 +454,7 b" if sys.platform == 'darwin' and os.path." | |||
|
454 | 454 | # distutils.sysconfig |
|
455 | 455 | version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines() |
|
456 | 456 | if version: |
|
457 |
version = version |
|
|
457 | version = version[0] | |
|
458 | 458 | xcode4 = (version.startswith('Xcode') and |
|
459 | 459 | StrictVersion(version.split()[1]) >= StrictVersion('4.0')) |
|
460 | 460 | else: |
@@ -212,6 +212,27 b' def rollback(server):' | |||
|
212 | 212 | runcommand(server, ['rollback']) |
|
213 | 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 | 236 | if __name__ == '__main__': |
|
216 | 237 | os.system('hg init') |
|
217 | 238 | |
@@ -232,3 +253,5 b" if __name__ == '__main__':" | |||
|
232 | 253 | check(tagscache) |
|
233 | 254 | check(setphase) |
|
234 | 255 | check(rollback) |
|
256 | check(branch) | |
|
257 | check(hgignore) |
@@ -145,3 +145,21 b' repository tip rolled back to revision 3' | |||
|
145 | 145 | working directory now based on revision 3 |
|
146 | 146 | runcommand phase -r . |
|
147 | 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 | 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 | 500 | Pushing to Publish=False (unknown changeset) |
|
469 | 501 | |
|
470 | 502 | $ hg push ../mu -r b740e3e5c05d # a-F |
General Comments 0
You need to be logged in to leave comments.
Login now