##// END OF EJS Templates
copies: add a HASCOPIESINFO flag to highlight rev with useful data...
marmoute -
r46263:2d6aea05 default
parent child Browse files
Show More
@@ -26,6 +26,7 b' from .utils import ('
26 dateutil,
26 dateutil,
27 stringutil,
27 stringutil,
28 )
28 )
29 from .revlogutils import flagutil
29
30
30 _defaultextra = {b'branch': b'default'}
31 _defaultextra = {b'branch': b'default'}
31
32
@@ -579,8 +580,17 b' class changelog(revlog.revlog):'
579 _(b'the name \'%s\' is reserved') % branch
580 _(b'the name \'%s\' is reserved') % branch
580 )
581 )
581 sortedfiles = sorted(files.touched)
582 sortedfiles = sorted(files.touched)
583 flags = 0
582 sidedata = None
584 sidedata = None
583 if self._copiesstorage == b'changeset-sidedata':
585 if self._copiesstorage == b'changeset-sidedata':
586 if (
587 files.removed
588 or files.merged
589 or files.salvaged
590 or files.copied_from_p1
591 or files.copied_from_p2
592 ):
593 flags |= flagutil.REVIDX_HASCOPIESINFO
584 sidedata = metadata.encode_files_sidedata(files)
594 sidedata = metadata.encode_files_sidedata(files)
585
595
586 if extra:
596 if extra:
@@ -28,12 +28,14 b' REVISION_FLAG_CENSORED = 1 << 15'
28 REVISION_FLAG_ELLIPSIS = 1 << 14
28 REVISION_FLAG_ELLIPSIS = 1 << 14
29 REVISION_FLAG_EXTSTORED = 1 << 13
29 REVISION_FLAG_EXTSTORED = 1 << 13
30 REVISION_FLAG_SIDEDATA = 1 << 12
30 REVISION_FLAG_SIDEDATA = 1 << 12
31 REVISION_FLAG_HASCOPIESINFO = 1 << 11
31
32
32 REVISION_FLAGS_KNOWN = (
33 REVISION_FLAGS_KNOWN = (
33 REVISION_FLAG_CENSORED
34 REVISION_FLAG_CENSORED
34 | REVISION_FLAG_ELLIPSIS
35 | REVISION_FLAG_ELLIPSIS
35 | REVISION_FLAG_EXTSTORED
36 | REVISION_FLAG_EXTSTORED
36 | REVISION_FLAG_SIDEDATA
37 | REVISION_FLAG_SIDEDATA
38 | REVISION_FLAG_HASCOPIESINFO
37 )
39 )
38
40
39 CG_DELTAMODE_STD = b'default'
41 CG_DELTAMODE_STD = b'default'
@@ -53,6 +53,7 b' from .revlogutils.flagutil import ('
53 REVIDX_ELLIPSIS,
53 REVIDX_ELLIPSIS,
54 REVIDX_EXTSTORED,
54 REVIDX_EXTSTORED,
55 REVIDX_FLAGS_ORDER,
55 REVIDX_FLAGS_ORDER,
56 REVIDX_HASCOPIESINFO,
56 REVIDX_ISCENSORED,
57 REVIDX_ISCENSORED,
57 REVIDX_RAWTEXT_CHANGING_FLAGS,
58 REVIDX_RAWTEXT_CHANGING_FLAGS,
58 REVIDX_SIDEDATA,
59 REVIDX_SIDEDATA,
@@ -98,6 +99,7 b' REVLOGV2_FLAGS'
98 REVIDX_ISCENSORED
99 REVIDX_ISCENSORED
99 REVIDX_ELLIPSIS
100 REVIDX_ELLIPSIS
100 REVIDX_SIDEDATA
101 REVIDX_SIDEDATA
102 REVIDX_HASCOPIESINFO
101 REVIDX_EXTSTORED
103 REVIDX_EXTSTORED
102 REVIDX_DEFAULT_FLAGS
104 REVIDX_DEFAULT_FLAGS
103 REVIDX_FLAGS_ORDER
105 REVIDX_FLAGS_ORDER
@@ -40,6 +40,8 b' REVIDX_ELLIPSIS = repository.REVISION_FL'
40 REVIDX_EXTSTORED = repository.REVISION_FLAG_EXTSTORED
40 REVIDX_EXTSTORED = repository.REVISION_FLAG_EXTSTORED
41 # revision data contains extra metadata not part of the official digest
41 # revision data contains extra metadata not part of the official digest
42 REVIDX_SIDEDATA = repository.REVISION_FLAG_SIDEDATA
42 REVIDX_SIDEDATA = repository.REVISION_FLAG_SIDEDATA
43 # revision changes files in a way that could affect copy tracing.
44 REVIDX_HASCOPIESINFO = repository.REVISION_FLAG_HASCOPIESINFO
43 REVIDX_DEFAULT_FLAGS = 0
45 REVIDX_DEFAULT_FLAGS = 0
44 # stable order in which flags need to be processed and their processors applied
46 # stable order in which flags need to be processed and their processors applied
45 REVIDX_FLAGS_ORDER = [
47 REVIDX_FLAGS_ORDER = [
@@ -47,6 +49,7 b' REVIDX_FLAGS_ORDER = ['
47 REVIDX_ELLIPSIS,
49 REVIDX_ELLIPSIS,
48 REVIDX_EXTSTORED,
50 REVIDX_EXTSTORED,
49 REVIDX_SIDEDATA,
51 REVIDX_SIDEDATA,
52 REVIDX_HASCOPIESINFO,
50 ]
53 ]
51
54
52 # bitmark for flags that could cause rawdata content change
55 # bitmark for flags that could cause rawdata content change
@@ -15,6 +15,7 b' from .constants import ('
15 REVIDX_ELLIPSIS,
15 REVIDX_ELLIPSIS,
16 REVIDX_EXTSTORED,
16 REVIDX_EXTSTORED,
17 REVIDX_FLAGS_ORDER,
17 REVIDX_FLAGS_ORDER,
18 REVIDX_HASCOPIESINFO,
18 REVIDX_ISCENSORED,
19 REVIDX_ISCENSORED,
19 REVIDX_RAWTEXT_CHANGING_FLAGS,
20 REVIDX_RAWTEXT_CHANGING_FLAGS,
20 REVIDX_SIDEDATA,
21 REVIDX_SIDEDATA,
@@ -28,6 +29,7 b' REVIDX_ISCENSORED'
28 REVIDX_ELLIPSIS
29 REVIDX_ELLIPSIS
29 REVIDX_EXTSTORED
30 REVIDX_EXTSTORED
30 REVIDX_SIDEDATA
31 REVIDX_SIDEDATA
32 REVIDX_HASCOPIESINFO,
31 REVIDX_DEFAULT_FLAGS
33 REVIDX_DEFAULT_FLAGS
32 REVIDX_FLAGS_ORDER
34 REVIDX_FLAGS_ORDER
33 REVIDX_RAWTEXT_CHANGING_FLAGS
35 REVIDX_RAWTEXT_CHANGING_FLAGS
@@ -37,6 +39,7 b' REVIDX_KNOWN_FLAGS = util.bitsfrom(REVID'
37 # Store flag processors (cf. 'addflagprocessor()' to register)
39 # Store flag processors (cf. 'addflagprocessor()' to register)
38 flagprocessors = {
40 flagprocessors = {
39 REVIDX_ISCENSORED: None,
41 REVIDX_ISCENSORED: None,
42 REVIDX_HASCOPIESINFO: None,
40 }
43 }
41
44
42
45
@@ -360,9 +360,11 b' lfs content, and the extension enabled.'
360 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
360 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
361 *** runcommand debugprocessors lfs.bin -R ../server
361 *** runcommand debugprocessors lfs.bin -R ../server
362 registered processor '0x8000'
362 registered processor '0x8000'
363 registered processor '0x800'
363 registered processor '0x2000'
364 registered processor '0x2000'
364 *** runcommand debugprocessors nonlfs2.txt -R ../server
365 *** runcommand debugprocessors nonlfs2.txt -R ../server
365 registered processor '0x8000'
366 registered processor '0x8000'
367 registered processor '0x800'
366 registered processor '0x2000'
368 registered processor '0x2000'
367 *** runcommand config extensions --cwd ../server
369 *** runcommand config extensions --cwd ../server
368 extensions.debugprocessors=$TESTTMP/debugprocessors.py
370 extensions.debugprocessors=$TESTTMP/debugprocessors.py
@@ -371,6 +373,7 b' lfs content, and the extension enabled.'
371 # LFS not enabled- revlogs don't have 0x2000 flag
373 # LFS not enabled- revlogs don't have 0x2000 flag
372 *** runcommand debugprocessors nonlfs3.txt
374 *** runcommand debugprocessors nonlfs3.txt
373 registered processor '0x8000'
375 registered processor '0x8000'
376 registered processor '0x800'
374 *** runcommand config extensions
377 *** runcommand config extensions
375 extensions.debugprocessors=$TESTTMP/debugprocessors.py
378 extensions.debugprocessors=$TESTTMP/debugprocessors.py
376
379
@@ -413,9 +416,11 b' lfs content, and the extension enabled.'
413 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
416 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag
414 *** runcommand debugprocessors lfs.bin -R ../server
417 *** runcommand debugprocessors lfs.bin -R ../server
415 registered processor '0x8000'
418 registered processor '0x8000'
419 registered processor '0x800'
416 registered processor '0x2000'
420 registered processor '0x2000'
417 *** runcommand debugprocessors nonlfs2.txt -R ../server
421 *** runcommand debugprocessors nonlfs2.txt -R ../server
418 registered processor '0x8000'
422 registered processor '0x8000'
423 registered processor '0x800'
419 registered processor '0x2000'
424 registered processor '0x2000'
420 *** runcommand config extensions --cwd ../server
425 *** runcommand config extensions --cwd ../server
421 extensions.debugprocessors=$TESTTMP/debugprocessors.py
426 extensions.debugprocessors=$TESTTMP/debugprocessors.py
@@ -424,6 +429,7 b' lfs content, and the extension enabled.'
424 # LFS enabled without requirement- revlogs have 0x2000 flag
429 # LFS enabled without requirement- revlogs have 0x2000 flag
425 *** runcommand debugprocessors nonlfs3.txt
430 *** runcommand debugprocessors nonlfs3.txt
426 registered processor '0x8000'
431 registered processor '0x8000'
432 registered processor '0x800'
427 registered processor '0x2000'
433 registered processor '0x2000'
428 *** runcommand config extensions
434 *** runcommand config extensions
429 extensions.debugprocessors=$TESTTMP/debugprocessors.py
435 extensions.debugprocessors=$TESTTMP/debugprocessors.py
@@ -432,6 +438,7 b' lfs content, and the extension enabled.'
432 # LFS disabled locally- revlogs don't have 0x2000 flag
438 # LFS disabled locally- revlogs don't have 0x2000 flag
433 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
439 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs
434 registered processor '0x8000'
440 registered processor '0x8000'
441 registered processor '0x800'
435 *** runcommand config extensions --cwd ../nonlfs
442 *** runcommand config extensions --cwd ../nonlfs
436 extensions.debugprocessors=$TESTTMP/debugprocessors.py
443 extensions.debugprocessors=$TESTTMP/debugprocessors.py
437 extensions.lfs=!
444 extensions.lfs=!
General Comments 0
You need to be logged in to leave comments. Login now