Show More
@@ -0,0 +1,20 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | mkdir a | |||
|
4 | cd a | |||
|
5 | hg init | |||
|
6 | echo foo > b | |||
|
7 | hg add b | |||
|
8 | hg ci -m "b" -d "0 0" | |||
|
9 | ||||
|
10 | chmod -w .hg | |||
|
11 | ||||
|
12 | cd .. | |||
|
13 | ||||
|
14 | hg clone a b | |||
|
15 | cd b | |||
|
16 | hg verify | |||
|
17 | ||||
|
18 | cd .. | |||
|
19 | ||||
|
20 | chmod +w a/.hg # let test clean up |
@@ -0,0 +1,10 b'' | |||||
|
1 | requesting all changes | |||
|
2 | adding changesets | |||
|
3 | adding manifests | |||
|
4 | adding file changes | |||
|
5 | added 1 changesets with 1 changes to 1 files | |||
|
6 | checking changesets | |||
|
7 | checking manifests | |||
|
8 | crosschecking files in changesets and manifests | |||
|
9 | checking files | |||
|
10 | 1 files, 1 changesets, 1 total revisions |
@@ -256,13 +256,13 b' def revtree(args, repo, full="tree", max' | |||||
256 | while visit: |
|
256 | while visit: | |
257 | n = visit.pop(0) |
|
257 | n = visit.pop(0) | |
258 | if n in stop_sha1: |
|
258 | if n in stop_sha1: | |
259 |
|
|
259 | continue | |
260 | for p in repo.changelog.parents(n): |
|
260 | for p in repo.changelog.parents(n): | |
261 | if p not in reachable[i]: |
|
261 | if p not in reachable[i]: | |
262 | reachable[i][p] = 1 |
|
262 | reachable[i][p] = 1 | |
263 | visit.append(p) |
|
263 | visit.append(p) | |
264 | if p in stop_sha1: |
|
264 | if p in stop_sha1: | |
265 |
|
|
265 | continue | |
266 |
|
266 | |||
267 | # walk the repository looking for commits that are in our |
|
267 | # walk the repository looking for commits that are in our | |
268 | # reachability graph |
|
268 | # reachability graph |
@@ -579,8 +579,11 b' def cat(ui, repo, file1, rev=None, **opt' | |||||
579 | change = repo.changelog.read(n) |
|
579 | change = repo.changelog.read(n) | |
580 | m = repo.manifest.read(change[0]) |
|
580 | m = repo.manifest.read(change[0]) | |
581 | n = m[relpath(repo, [file1])[0]] |
|
581 | n = m[relpath(repo, [file1])[0]] | |
582 | except hg.RepoError, KeyError: |
|
582 | except (hg.RepoError, KeyError): | |
583 | n = r.lookup(rev) |
|
583 | try: | |
|
584 | n = r.lookup(rev) | |||
|
585 | except KeyError, inst: | |||
|
586 | raise util.Abort('cannot find file %s in rev %s', file1, rev) | |||
584 | else: |
|
587 | else: | |
585 | n = r.tip() |
|
588 | n = r.tip() | |
586 | fp = make_file(repo, r, opts['output'], node=n) |
|
589 | fp = make_file(repo, r, opts['output'], node=n) | |
@@ -618,15 +621,23 b' def clone(ui, source, dest=None, **opts)' | |||||
618 | abspath = source |
|
621 | abspath = source | |
619 | other = hg.repository(ui, source) |
|
622 | other = hg.repository(ui, source) | |
620 |
|
623 | |||
|
624 | copy = False | |||
621 | if other.dev() != -1: |
|
625 | if other.dev() != -1: | |
622 | abspath = os.path.abspath(source) |
|
626 | abspath = os.path.abspath(source) | |
|
627 | copy = True | |||
623 |
|
628 | |||
624 | # we use a lock here because if we race with commit, we can |
|
629 | if copy: | |
625 | # end up with extra data in the cloned revlogs that's not |
|
630 | try: | |
626 | # pointed to by changesets, thus causing verify to fail |
|
631 | # we use a lock here because if we race with commit, we | |
627 | l1 = lock.lock(os.path.join(source, ".hg", "lock")) |
|
632 | # can end up with extra data in the cloned revlogs that's | |
|
633 | # not pointed to by changesets, thus causing verify to | |||
|
634 | # fail | |||
|
635 | l1 = lock.lock(os.path.join(source, ".hg", "lock")) | |||
|
636 | except OSError: | |||
|
637 | copy = False | |||
628 |
|
638 | |||
629 | # and here to avoid premature writing to the target |
|
639 | if copy: | |
|
640 | # we lock here to avoid premature writing to the target | |||
630 | os.mkdir(os.path.join(dest, ".hg")) |
|
641 | os.mkdir(os.path.join(dest, ".hg")) | |
631 | l2 = lock.lock(os.path.join(dest, ".hg", "lock")) |
|
642 | l2 = lock.lock(os.path.join(dest, ".hg", "lock")) | |
632 |
|
643 |
General Comments 0
You need to be logged in to leave comments.
Login now