Show More
@@ -1031,10 +1031,10 b' class queue:' | |||||
1031 | m = util.unique(mm) |
|
1031 | m = util.unique(mm) | |
1032 | r = util.unique(dd) |
|
1032 | r = util.unique(dd) | |
1033 | a = util.unique(aa) |
|
1033 | a = util.unique(aa) | |
1034 |
|
|
1034 | c = [filter(matchfn, l) for l in (m, a, r, [], u)] | |
|
1035 | filelist = util.unique(c[0] + c[1] + c[2]) | |||
1035 | patch.diff(repo, patchparent, files=filelist, match=matchfn, |
|
1036 | patch.diff(repo, patchparent, files=filelist, match=matchfn, | |
1036 |
fp=patchf, changes= |
|
1037 | fp=patchf, changes=c, opts=self.diffopts()) | |
1037 | opts=self.diffopts()) |
|
|||
1038 | patchf.close() |
|
1038 | patchf.close() | |
1039 |
|
1039 | |||
1040 | repo.dirstate.setparents(*cparents) |
|
1040 | repo.dirstate.setparents(*cparents) | |
@@ -1082,7 +1082,8 b' class queue:' | |||||
1082 | message = msg |
|
1082 | message = msg | |
1083 |
|
1083 | |||
1084 | self.strip(repo, top, update=False, backup='strip', wlock=wlock) |
|
1084 | self.strip(repo, top, update=False, backup='strip', wlock=wlock) | |
1085 |
n = repo.commit(filelist, message, changes[1], |
|
1085 | n = repo.commit(filelist, message, changes[1], match=matchfn, | |
|
1086 | force=1, wlock=wlock) | |||
1086 | self.applied[-1] = statusentry(revlog.hex(n), patchfn) |
|
1087 | self.applied[-1] = statusentry(revlog.hex(n), patchfn) | |
1087 | self.applied_dirty = 1 |
|
1088 | self.applied_dirty = 1 | |
1088 | else: |
|
1089 | else: | |
@@ -1527,7 +1528,11 b' def clone(ui, source, dest=None, **opts)' | |||||
1527 | if sr.mq.applied: |
|
1528 | if sr.mq.applied: | |
1528 | qbase = revlog.bin(sr.mq.applied[0].rev) |
|
1529 | qbase = revlog.bin(sr.mq.applied[0].rev) | |
1529 | if not hg.islocal(dest): |
|
1530 | if not hg.islocal(dest): | |
1530 | destrev = sr.parents(qbase)[0] |
|
1531 | heads = dict.fromkeys(sr.heads()) | |
|
1532 | for h in sr.heads(qbase): | |||
|
1533 | del heads[h] | |||
|
1534 | destrev = heads.keys() | |||
|
1535 | destrev.append(sr.changelog.parents(qbase)[0]) | |||
1531 | ui.note(_('cloning main repo\n')) |
|
1536 | ui.note(_('cloning main repo\n')) | |
1532 | sr, dr = hg.clone(ui, sr, dest, |
|
1537 | sr, dr = hg.clone(ui, sr, dest, | |
1533 | pull=opts['pull'], |
|
1538 | pull=opts['pull'], |
@@ -375,7 +375,7 b' class dirstate(object):' | |||||
375 |
|
375 | |||
376 | # walk all files by default |
|
376 | # walk all files by default | |
377 | if not files: |
|
377 | if not files: | |
378 |
files = [ |
|
378 | files = ['.'] | |
379 | dc = self.map.copy() |
|
379 | dc = self.map.copy() | |
380 | else: |
|
380 | else: | |
381 | files = util.unique(files) |
|
381 | files = util.unique(files) |
@@ -31,8 +31,8 b' class localrepository(repo.repository):' | |||||
31 | " here (.hg not found)")) |
|
31 | " here (.hg not found)")) | |
32 | path = p |
|
32 | path = p | |
33 |
|
33 | |||
34 | self.path = os.path.join(path, ".hg") |
|
|||
35 | self.root = os.path.realpath(path) |
|
34 | self.root = os.path.realpath(path) | |
|
35 | self.path = os.path.join(self.root, ".hg") | |||
36 | self.origroot = path |
|
36 | self.origroot = path | |
37 | self.opener = util.opener(self.path) |
|
37 | self.opener = util.opener(self.path) | |
38 | self.wopener = util.opener(self.root) |
|
38 | self.wopener = util.opener(self.root) |
@@ -444,15 +444,15 b' def update(repo, node, branchmerge, forc' | |||||
444 | wlock = working dir lock, if already held |
|
444 | wlock = working dir lock, if already held | |
445 | """ |
|
445 | """ | |
446 |
|
446 | |||
447 | if node is None: |
|
|||
448 | node = "tip" |
|
|||
449 |
|
||||
450 | if not wlock: |
|
447 | if not wlock: | |
451 | wlock = repo.wlock() |
|
448 | wlock = repo.wlock() | |
452 |
|
449 | |||
|
450 | wc = repo.workingctx() | |||
|
451 | if node is None: | |||
|
452 | # tip of current branch | |||
|
453 | node = repo.branchtags()[wc.branch()] | |||
453 | overwrite = force and not branchmerge |
|
454 | overwrite = force and not branchmerge | |
454 | forcemerge = force and branchmerge |
|
455 | forcemerge = force and branchmerge | |
455 | wc = repo.workingctx() |
|
|||
456 | pl = wc.parents() |
|
456 | pl = wc.parents() | |
457 | p1, p2 = pl[0], repo.changectx(node) |
|
457 | p1, p2 = pl[0], repo.changectx(node) | |
458 | pa = p1.ancestor(p2) |
|
458 | pa = p1.ancestor(p2) |
@@ -89,6 +89,18 b' sed -e "s/^\\(diff -r \\)\\([a-f0-9]* \\)/\\1' | |||||
89 | -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
|
89 | -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ | |
90 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch |
|
90 | -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch | |
91 |
|
91 | |||
|
92 | echo % empty qrefresh | |||
|
93 | ||||
|
94 | hg qrefresh -X a | |||
|
95 | echo 'revision:' | |||
|
96 | hg diff -r -2 -r -1 | |||
|
97 | echo 'patch:' | |||
|
98 | cat .hg/patches/test.patch | |||
|
99 | echo 'working dir diff:' | |||
|
100 | hg diff --nodates -q | |||
|
101 | # restore things | |||
|
102 | hg qrefresh | |||
|
103 | ||||
92 | echo % qpop |
|
104 | echo % qpop | |
93 |
|
105 | |||
94 | hg qpop |
|
106 | hg qpop |
@@ -91,6 +91,17 b' diff -r xa' | |||||
91 | @@ -1,1 +1,2 @@ a |
|
91 | @@ -1,1 +1,2 @@ a | |
92 | a |
|
92 | a | |
93 | +a |
|
93 | +a | |
|
94 | % empty qrefresh | |||
|
95 | revision: | |||
|
96 | patch: | |||
|
97 | foo bar | |||
|
98 | ||||
|
99 | working dir diff: | |||
|
100 | --- a/a | |||
|
101 | +++ b/a | |||
|
102 | @@ -1,1 +1,2 @@ a | |||
|
103 | a | |||
|
104 | +a | |||
94 | % qpop |
|
105 | % qpop | |
95 | Patch queue now empty |
|
106 | Patch queue now empty | |
96 | % qpush |
|
107 | % qpush |
@@ -63,3 +63,11 b' except ValueError, inst:' | |||||
63 | else: |
|
63 | else: | |
64 | print "ValueError: %s" % inst |
|
64 | print "ValueError: %s" % inst | |
65 | EOF |
|
65 | EOF | |
|
66 | ||||
|
67 | echo % update with no arguments: tipmost revision of the current branch | |||
|
68 | hg up -q -C 0 | |||
|
69 | hg up -q | |||
|
70 | hg id | |||
|
71 | hg up -q 1 | |||
|
72 | hg up -q | |||
|
73 | hg id |
@@ -94,3 +94,6 b' foo 4:4909a37' | |||||
94 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca |
|
94 | bar 2:67ec16bde7f1575d523313b9bca000f6a6f12dca | |
95 | % test old hg reading branch cache with feature list |
|
95 | % test old hg reading branch cache with feature list | |
96 | ValueError raised correctly, good. |
|
96 | ValueError raised correctly, good. | |
|
97 | % update with no arguments: tipmost revision of the current branch | |||
|
98 | bf1bc2f45e83 | |||
|
99 | 4909a3732169 (foo) tip |
General Comments 0
You need to be logged in to leave comments.
Login now