##// END OF EJS Templates
mq: omit ".hgsubstate" from qnew/qrefresh target list for consistent node hash...
FUJIWARA Katsunori -
r20786:d666da07 default
parent child Browse files
Show More
@@ -1035,7 +1035,6 class queue(object):
1035 1035 self.checkpatchname(patchfn)
1036 1036 inclsubs = checksubstate(repo)
1037 1037 if inclsubs:
1038 inclsubs.append('.hgsubstate')
1039 1038 substatestate = repo.dirstate['.hgsubstate']
1040 1039 if opts.get('include') or opts.get('exclude') or pats:
1041 1040 match = scmutil.match(repo[None], pats, opts)
@@ -1045,14 +1044,14 class queue(object):
1045 1044 raise util.Abort('%s: %s' % (f, msg))
1046 1045 match.bad = badfn
1047 1046 changes = repo.status(match=match)
1048 m, a, r, d = changes[:4]
1049 1047 else:
1050 1048 changes = self.checklocalchanges(repo, force=True)
1051 m, a, r, d = changes
1052 match = scmutil.matchfiles(repo, m + a + r + inclsubs)
1049 commitfiles = list(inclsubs)
1050 for files in changes[:3]:
1051 commitfiles.extend([f for f in files if f != '.hgsubstate'])
1052 match = scmutil.matchfiles(repo, commitfiles)
1053 1053 if len(repo[None].parents()) > 1:
1054 1054 raise util.Abort(_('cannot manage merge changesets'))
1055 commitfiles = m + a + r
1056 1055 self.checktoppatch(repo)
1057 1056 insert = self.fullseriesend()
1058 1057 wlock = repo.wlock()
@@ -1492,7 +1491,6 class queue(object):
1492 1491
1493 1492 inclsubs = checksubstate(repo, hex(patchparent))
1494 1493 if inclsubs:
1495 inclsubs.append('.hgsubstate')
1496 1494 substatestate = repo.dirstate['.hgsubstate']
1497 1495
1498 1496 ph = patchheader(self.join(patchfn), self.plainmode)
@@ -1579,7 +1577,7 class queue(object):
1579 1577
1580 1578 files = set(inclsubs)
1581 1579 for x in refreshchanges:
1582 files.update(x)
1580 files.update([f for f in x if f != '.hgsubstate'])
1583 1581 match = scmutil.matchfiles(repo, files)
1584 1582
1585 1583 bmlist = repo[top].bookmarks()
@@ -407,12 +407,12 both into 'revision' and 'patch file und
407 407 $ cat .hgsubstate
408 408 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
409 409 $ hg diff -c tip
410 diff -r f499373e340c -r b20ffac88564 .hgsub
410 diff -r f499373e340c -r f69e96d86e75 .hgsub
411 411 --- /dev/null
412 412 +++ b/.hgsub
413 413 @@ -0,0 +1,1 @@
414 414 +sub = sub
415 diff -r f499373e340c -r b20ffac88564 .hgsubstate
415 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
416 416 --- /dev/null
417 417 +++ b/.hgsubstate
418 418 @@ -0,0 +1,1 @@
@@ -423,16 +423,34 both into 'revision' and 'patch file und
423 423 # User test
424 424 # Date 0 0
425 425
426 diff -r f499373e340c -r b20ffac88564 .hgsub
426 diff -r f499373e340c -r f69e96d86e75 .hgsub
427 427 --- /dev/null
428 428 +++ b/.hgsub
429 429 @@ -0,0 +1,1 @@
430 430 +sub = sub
431 diff -r f499373e340c -r b20ffac88564 .hgsubstate
431 diff -r f499373e340c -r f69e96d86e75 .hgsubstate
432 432 --- /dev/null
433 433 +++ b/.hgsubstate
434 434 @@ -0,0 +1,1 @@
435 435 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
436 $ hg parents --template '{node}\n'
437 f69e96d86e75a6d4fd88285dc9697acb23951041
438
439 check also whether qnew not including ".hgsubstate" explicitly causes
440 as same result (in node hash) as one including it.
441
442 $ hg qpop -a -q
443 patch queue now empty
444 $ hg qdelete import-at-qnew
445 $ echo 'sub = sub' > .hgsub
446 $ hg add .hgsub
447 $ rm -f .hgsubstate
448 $ hg qnew -u test -d '0 0' import-at-qnew
449 $ hg parents --template '{node}\n'
450 f69e96d86e75a6d4fd88285dc9697acb23951041
451
452 check whether qrefresh imports updated .hgsubstate correctly
453
436 454 $ hg qpop
437 455 popping import-at-qnew
438 456 patch queue now empty
@@ -537,6 +555,31 both into 'revision' and 'patch file und
537 555 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
538 556 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
539 557
558 check whether qrefresh not including ".hgsubstate" explicitly causes
559 as same result (in node hash) as one including it.
560
561 $ hg update -C -q 0
562 $ hg qpop -a -q
563 patch queue now empty
564 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
565 $ echo 'sub = sub' > .hgsub
566 $ echo > .hgsubstate
567 $ hg add .hgsub .hgsubstate
568 $ hg qrefresh -u test -d '0 0'
569 $ hg parents --template '{node}\n'
570 7c48c35501aae6770ed9c2517014628615821a8e
571
572 $ hg qpop -a -q
573 patch queue now empty
574 $ hg qdelete add-hgsub-at-qrefresh
575 $ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
576 $ echo 'sub = sub' > .hgsub
577 $ hg add .hgsub
578 $ rm -f .hgsubstate
579 $ hg qrefresh -u test -d '0 0'
580 $ hg parents --template '{node}\n'
581 7c48c35501aae6770ed9c2517014628615821a8e
582
540 583 $ cd ..
541 584
542 585 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now