Show More
@@ -13,7 +13,7 b' def diffstat(ui, repo, **kwargs):' | |||
|
13 | 13 | if kwargs.get('parent2'): |
|
14 | 14 | return |
|
15 | 15 | node = kwargs['node'] |
|
16 |
first = repo[node].p |
|
|
16 | first = repo[node].p1().node() | |
|
17 | 17 | if 'url' in kwargs: |
|
18 | 18 | last = repo['tip'].node() |
|
19 | 19 | else: |
@@ -126,7 +126,7 b' def dodiff(ui, repo, diffcmd, diffopts, ' | |||
|
126 | 126 | else: |
|
127 | 127 | node1a, node2 = cmdutil.revpair(repo, revs) |
|
128 | 128 | if not revs: |
|
129 |
node1b = repo.dirstate.p |
|
|
129 | node1b = repo.dirstate.p2() | |
|
130 | 130 | else: |
|
131 | 131 | node1b = nullid |
|
132 | 132 |
@@ -75,7 +75,7 b' class ciamsg(object):' | |||
|
75 | 75 | |
|
76 | 76 | def fileelems(self): |
|
77 | 77 | n = self.ctx.node() |
|
78 |
f = self.cia.repo.status(self.ctx.p |
|
|
78 | f = self.cia.repo.status(self.ctx.p1().node(), n) | |
|
79 | 79 | url = self.url or '' |
|
80 | 80 | elems = [] |
|
81 | 81 | for path in f[0]: |
@@ -899,7 +899,7 b' class queue(object):' | |||
|
899 | 899 | else: |
|
900 | 900 | p.write("# HG changeset patch\n") |
|
901 | 901 | p.write("# Parent " |
|
902 |
+ hex(repo[None].p |
|
|
902 | + hex(repo[None].p1().node()) + "\n") | |
|
903 | 903 | if user: |
|
904 | 904 | p.write("# User " + user + "\n") |
|
905 | 905 | if date: |
@@ -1054,7 +1054,7 b' class queue(object):' | |||
|
1054 | 1054 | heads += ls |
|
1055 | 1055 | if not heads: |
|
1056 | 1056 | heads = [nullid] |
|
1057 |
if repo.dirstate.p |
|
|
1057 | if repo.dirstate.p1() not in heads and not exact: | |
|
1058 | 1058 | self.ui.status(_("(working directory not at a head)\n")) |
|
1059 | 1059 | |
|
1060 | 1060 | if not self.series: |
@@ -1148,7 +1148,7 b' class queue(object):' | |||
|
1148 | 1148 | ret = self.apply(repo, s, list, all_files=all_files) |
|
1149 | 1149 | except: |
|
1150 | 1150 | self.ui.warn(_('cleaning up working directory...')) |
|
1151 |
node = repo.dirstate.p |
|
|
1151 | node = repo.dirstate.p1() | |
|
1152 | 1152 | hg.revert(repo, node, None) |
|
1153 | 1153 | # only remove unknown files that we know we touched or |
|
1154 | 1154 | # created while patching |
@@ -249,7 +249,7 b' class notifier(object):' | |||
|
249 | 249 | def diff(self, ctx, ref=None): |
|
250 | 250 | |
|
251 | 251 | maxdiff = int(self.ui.config('notify', 'maxdiff', 300)) |
|
252 |
prev = ctx.p |
|
|
252 | prev = ctx.p1().node() | |
|
253 | 253 | ref = ref and ref.node() or ctx.node() |
|
254 | 254 | chunks = patch.diff(self.repo, prev, ref, opts=patch.diffopts(self.ui)) |
|
255 | 255 | difflines = ''.join(chunks).splitlines() |
@@ -300,7 +300,7 b' def rebasenode(repo, rev, p1, p2, state)' | |||
|
300 | 300 | repo.ui.debug(" merge against %d:%s\n" % (repo[rev].rev(), repo[rev])) |
|
301 | 301 | base = None |
|
302 | 302 | if repo[rev].rev() != repo[min(state)].rev(): |
|
303 |
base = repo[rev].p |
|
|
303 | base = repo[rev].p1().node() | |
|
304 | 304 | return merge.update(repo, rev, True, True, False, base) |
|
305 | 305 | |
|
306 | 306 | def defineparents(repo, rev, target, state, targetancestors): |
@@ -469,7 +469,7 b' def dorecord(ui, repo, commitfunc, *pats' | |||
|
469 | 469 | |
|
470 | 470 | # 3a. apply filtered patch to clean repo (clean) |
|
471 | 471 | if backups: |
|
472 |
hg.revert(repo, repo.dirstate.p |
|
|
472 | hg.revert(repo, repo.dirstate.p1(), | |
|
473 | 473 | lambda key: key in backups) |
|
474 | 474 | |
|
475 | 475 | # 3b. (apply) |
@@ -237,7 +237,7 b' class transplanter(object):' | |||
|
237 | 237 | seriespath = os.path.join(self.path, 'series') |
|
238 | 238 | if os.path.exists(seriespath): |
|
239 | 239 | os.unlink(seriespath) |
|
240 |
p1 = repo.dirstate.p |
|
|
240 | p1 = repo.dirstate.p1() | |
|
241 | 241 | p2 = node |
|
242 | 242 | self.log(user, date, message, p1, p2, merge=merge) |
|
243 | 243 | self.ui.write(str(inst) + '\n') |
@@ -72,7 +72,7 b' def findrepo(p):' | |||
|
72 | 72 | return p |
|
73 | 73 | |
|
74 | 74 | def bail_if_changed(repo): |
|
75 |
if repo.dirstate.p |
|
|
75 | if repo.dirstate.p2() != nullid: | |
|
76 | 76 | raise util.Abort(_('outstanding uncommitted merge')) |
|
77 | 77 | modified, added, removed, deleted = repo.status()[:4] |
|
78 | 78 | if modified or added or removed or deleted: |
@@ -122,12 +122,12 b" def revsingle(repo, revspec, default='.'" | |||
|
122 | 122 | |
|
123 | 123 | def revpair(repo, revs): |
|
124 | 124 | if not revs: |
|
125 |
return repo.dirstate.p |
|
|
125 | return repo.dirstate.p1(), None | |
|
126 | 126 | |
|
127 | 127 | l = revrange(repo, revs) |
|
128 | 128 | |
|
129 | 129 | if len(l) == 0: |
|
130 |
return repo.dirstate.p |
|
|
130 | return repo.dirstate.p1(), None | |
|
131 | 131 | |
|
132 | 132 | if len(l) == 1: |
|
133 | 133 | return repo.lookup(l[0]), None |
@@ -596,7 +596,7 b' def branch(ui, repo, label=None, **opts)' | |||
|
596 | 596 | """ |
|
597 | 597 | |
|
598 | 598 | if opts.get('clean'): |
|
599 |
label = repo[None].p |
|
|
599 | label = repo[None].p1().branch() | |
|
600 | 600 | repo.dirstate.setbranch(label) |
|
601 | 601 | ui.status(_('reset working directory to branch %s\n') % label) |
|
602 | 602 | elif label: |
@@ -1678,7 +1678,7 b' def diff(ui, repo, *pats, **opts):' | |||
|
1678 | 1678 | raise util.Abort(msg) |
|
1679 | 1679 | elif change: |
|
1680 | 1680 | node2 = cmdutil.revsingle(repo, change, None).node() |
|
1681 |
node1 = repo[node2].p |
|
|
1681 | node1 = repo[node2].p1().node() | |
|
1682 | 1682 | else: |
|
1683 | 1683 | node1, node2 = cmdutil.revpair(repo, revs) |
|
1684 | 1684 | |
@@ -1905,7 +1905,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||
|
1905 | 1905 | |
|
1906 | 1906 | def prep(ctx, fns): |
|
1907 | 1907 | rev = ctx.rev() |
|
1908 |
pctx = ctx.p |
|
|
1908 | pctx = ctx.p1() | |
|
1909 | 1909 | parent = pctx.rev() |
|
1910 | 1910 | matches.setdefault(rev, {}) |
|
1911 | 1911 | matches.setdefault(parent, {}) |
@@ -1940,7 +1940,7 b' def grep(ui, repo, pattern, *pats, **opt' | |||
|
1940 | 1940 | |
|
1941 | 1941 | for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep): |
|
1942 | 1942 | rev = ctx.rev() |
|
1943 |
parent = ctx.p |
|
|
1943 | parent = ctx.p1().rev() | |
|
1944 | 1944 | for fn in sorted(revfiles.get(rev, [])): |
|
1945 | 1945 | states = matches[rev][fn] |
|
1946 | 1946 | copy = copies.get(rev, {}).get(fn) |
@@ -2840,7 +2840,7 b' def merge(ui, repo, node=None, **opts):' | |||
|
2840 | 2840 | '(run \'hg heads .\' to see heads)') |
|
2841 | 2841 | % (branch, len(bheads))) |
|
2842 | 2842 | |
|
2843 |
parent = repo.dirstate.p |
|
|
2843 | parent = repo.dirstate.p1() | |
|
2844 | 2844 | if len(bheads) == 1: |
|
2845 | 2845 | if len(repo.heads()) > 1: |
|
2846 | 2846 | raise util.Abort(_( |
@@ -3751,7 +3751,7 b' def status(ui, repo, *pats, **opts):' | |||
|
3751 | 3751 | raise util.Abort(msg) |
|
3752 | 3752 | elif change: |
|
3753 | 3753 | node2 = repo.lookup(change) |
|
3754 |
node1 = repo[node2].p |
|
|
3754 | node1 = repo[node2].p1().node() | |
|
3755 | 3755 | else: |
|
3756 | 3756 | node1, node2 = cmdutil.revpair(repo, revs) |
|
3757 | 3757 |
@@ -93,7 +93,7 b' def copies(repo, c1, c2, ca, checkdirs=F' | |||
|
93 | 93 | return {}, {} |
|
94 | 94 | |
|
95 | 95 | # avoid silly behavior for parent -> working dir |
|
96 |
if c2.node() is None and c1.node() == repo.dirstate.p |
|
|
96 | if c2.node() is None and c1.node() == repo.dirstate.p1(): | |
|
97 | 97 | return repo.dirstate.copies(), {} |
|
98 | 98 | |
|
99 | 99 | limit = _findlimit(repo, c1.rev(), c2.rev()) |
@@ -522,7 +522,7 b' class localrepository(repo.repository):' | |||
|
522 | 522 | if isinstance(key, int): |
|
523 | 523 | return self.changelog.node(key) |
|
524 | 524 | elif key == '.': |
|
525 |
return self.dirstate.p |
|
|
525 | return self.dirstate.p1() | |
|
526 | 526 | elif key == 'null': |
|
527 | 527 | return nullid |
|
528 | 528 | elif key == 'tip': |
@@ -268,7 +268,7 b' def applyupdates(repo, action, wctx, mct' | |||
|
268 | 268 | |
|
269 | 269 | updated, merged, removed, unresolved = 0, 0, 0, 0 |
|
270 | 270 | ms = mergestate(repo) |
|
271 |
ms.reset(wctx.p |
|
|
271 | ms.reset(wctx.p1().node()) | |
|
272 | 272 | moves = [] |
|
273 | 273 | action.sort(key=actionkey) |
|
274 | 274 | substate = wctx.substate # prime |
@@ -286,7 +286,7 b' def applyupdates(repo, action, wctx, mct' | |||
|
286 | 286 | fco = mctx[f2] |
|
287 | 287 | if mctx == actx: # backwards, use working dir parent as ancestor |
|
288 | 288 | if fcl.parents(): |
|
289 |
fca = fcl.p |
|
|
289 | fca = fcl.p1() | |
|
290 | 290 | else: |
|
291 | 291 | fca = repo.filectx(f, fileid=nullrev) |
|
292 | 292 | else: |
@@ -1324,7 +1324,7 b' def diff(repo, node1=None, node2=None, m' | |||
|
1324 | 1324 | opts = mdiff.defaultopts |
|
1325 | 1325 | |
|
1326 | 1326 | if not node1 and not node2: |
|
1327 |
node1 = repo.dirstate.p |
|
|
1327 | node1 = repo.dirstate.p1() | |
|
1328 | 1328 | |
|
1329 | 1329 | def lrugetfilectx(): |
|
1330 | 1330 | cache = {} |
@@ -207,7 +207,7 b' def p1(repo, subset, x):' | |||
|
207 | 207 | First parent of changesets in set, or the working directory. |
|
208 | 208 | """ |
|
209 | 209 | if x is None: |
|
210 |
p = repo[x].p |
|
|
210 | p = repo[x].p1().rev() | |
|
211 | 211 | return [r for r in subset if r == p] |
|
212 | 212 | |
|
213 | 213 | ps = set() |
@@ -73,8 +73,7 b' def showlist(name, values, plural=None, ' | |||
|
73 | 73 | |
|
74 | 74 | def getfiles(repo, ctx, revcache): |
|
75 | 75 | if 'files' not in revcache: |
|
76 |
revcache['files'] = repo.status(ctx.p |
|
|
77 | ctx.node())[:3] | |
|
76 | revcache['files'] = repo.status(ctx.p1().node(), ctx.node())[:3] | |
|
78 | 77 | return revcache['files'] |
|
79 | 78 | |
|
80 | 79 | def getlatesttags(repo, ctx, cache): |
General Comments 0
You need to be logged in to leave comments.
Login now