##// END OF EJS Templates
cmdutil: apply dirstate.normallookup on (maybe partially) committed files...
FUJIWARA Katsunori -
r25759:ff11c156 default
parent child Browse files
Show More
@@ -203,8 +203,16 b' def dorecord(ui, repo, commitfunc, cmdsu'
203 finally:
203 finally:
204 # 5. finally restore backed-up files
204 # 5. finally restore backed-up files
205 try:
205 try:
206 dirstate = repo.dirstate
206 for realname, tmpname in backups.iteritems():
207 for realname, tmpname in backups.iteritems():
207 ui.debug('restoring %r to %r\n' % (tmpname, realname))
208 ui.debug('restoring %r to %r\n' % (tmpname, realname))
209
210 if dirstate[realname] == 'n':
211 # without normallookup, restoring timestamp
212 # may cause partially committed files
213 # to be treated as unmodified
214 dirstate.normallookup(realname)
215
208 util.copyfile(tmpname, repo.wjoin(realname))
216 util.copyfile(tmpname, repo.wjoin(realname))
209 # Our calls to copystat() here and above are a
217 # Our calls to copystat() here and above are a
210 # hack to trick any editors that have f open that
218 # hack to trick any editors that have f open that
@@ -1381,6 +1381,8 b' Ignore win32text deprecation warning for'
1381 record this change to 'subdir/f1'? [Ynesfdaq?] y
1381 record this change to 'subdir/f1'? [Ynesfdaq?] y
1382
1382
1383
1383
1384 $ hg status -A subdir/f1
1385 C subdir/f1
1384 $ hg tip -p
1386 $ hg tip -p
1385 changeset: 28:* (glob)
1387 changeset: 28:* (glob)
1386 tag: tip
1388 tag: tip
@@ -1417,6 +1419,8 b' Test --user when ui.username not set'
1417 +e
1419 +e
1418 record this change to 'subdir/f1'? [Ynesfdaq?] y
1420 record this change to 'subdir/f1'? [Ynesfdaq?] y
1419
1421
1422 $ hg status -A subdir/f1
1423 C subdir/f1
1420 $ hg log --template '{author}\n' -l 1
1424 $ hg log --template '{author}\n' -l 1
1421 xyz
1425 xyz
1422 $ HGUSER="test"
1426 $ HGUSER="test"
@@ -1426,7 +1430,7 b' Test --user when ui.username not set'
1426 Moving files
1430 Moving files
1427
1431
1428 $ hg update -C .
1432 $ hg update -C .
1429 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1433 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1430 $ hg mv plain plain3
1434 $ hg mv plain plain3
1431 $ echo somechange >> plain3
1435 $ echo somechange >> plain3
1432 $ hg commit -i -d '23 0' -mmoving_files << EOF
1436 $ hg commit -i -d '23 0' -mmoving_files << EOF
@@ -1447,6 +1451,8 b' Moving files'
1447 record this change to 'plain3'? [Ynesfdaq?] y
1451 record this change to 'plain3'? [Ynesfdaq?] y
1448
1452
1449 The #if execbit block above changes the hash here on some systems
1453 The #if execbit block above changes the hash here on some systems
1454 $ hg status -A plain3
1455 C plain3
1450 $ hg tip
1456 $ hg tip
1451 changeset: 30:* (glob)
1457 changeset: 30:* (glob)
1452 tag: tip
1458 tag: tip
@@ -1526,3 +1532,98 b' The #if execbit block above changes the '
1526 +foo
1532 +foo
1527
1533
1528 $ cd ..
1534 $ cd ..
1535
1536 $ hg status -A folder/bar
1537 C folder/bar
1538
1539 Clear win32text configuration before size/timestamp sensitive test
1540
1541 $ cat >> .hg/hgrc <<EOF
1542 > [extensions]
1543 > win32text = !
1544 > [decode]
1545 > ** = !
1546 > [encode]
1547 > ** = !
1548 > [patch]
1549 > eol = strict
1550 > EOF
1551 $ hg update -q -C null
1552 $ hg update -q -C tip
1553
1554 Test that partially committed file is still treated as "modified",
1555 even if none of mode, size and timestamp is changed on the filesystem
1556 (see also issue4583).
1557
1558 $ cat > subdir/f1 <<EOF
1559 > A
1560 > a
1561 > a
1562 > b
1563 > c
1564 > d
1565 > E
1566 > EOF
1567 $ hg diff --git subdir/f1
1568 diff --git a/subdir/f1 b/subdir/f1
1569 --- a/subdir/f1
1570 +++ b/subdir/f1
1571 @@ -1,7 +1,7 @@
1572 -a
1573 +A
1574 a
1575 a
1576 b
1577 c
1578 d
1579 -e
1580 +E
1581
1582 $ touch -t 200001010000 subdir/f1
1583
1584 $ cat >> .hg/hgrc <<EOF
1585 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
1586 > [fakepatchtime]
1587 > fakenow = 200001010000
1588 >
1589 > [extensions]
1590 > fakepatchtime = $TESTDIR/fakepatchtime.py
1591 > EOF
1592 $ hg commit -i -m 'commit subdir/f1 partially' <<EOF
1593 > y
1594 > y
1595 > n
1596 > EOF
1597 diff --git a/subdir/f1 b/subdir/f1
1598 2 hunks, 2 lines changed
1599 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1600
1601 @@ -1,6 +1,6 @@
1602 -a
1603 +A
1604 a
1605 a
1606 b
1607 c
1608 d
1609 record change 1/2 to 'subdir/f1'? [Ynesfdaq?] y
1610
1611 @@ -2,6 +2,6 @@
1612 a
1613 a
1614 b
1615 c
1616 d
1617 -e
1618 +E
1619 record change 2/2 to 'subdir/f1'? [Ynesfdaq?] n
1620
1621 $ cat >> .hg/hgrc <<EOF
1622 > [extensions]
1623 > fakepatchtime = !
1624 > EOF
1625
1626 $ hg debugstate | grep ' subdir/f1$'
1627 n 0 -1 unset subdir/f1
1628 $ hg status -A subdir/f1
1629 M subdir/f1
General Comments 0
You need to be logged in to leave comments. Login now