Mercurial > hg
comparison hgext/convert/cvsps.py @ 37884:72284d296b02
cvsps: add b prefixes to regular expressions
# skip-blame just b prefixes
Differential Revision: https://phab.mercurial-scm.org/D3482
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 27 Apr 2018 01:14:23 -0400 |
parents | 34758397ad1b |
children | fe148d7544a4 |
comparison
equal
deleted
inserted
replaced
37883:a61583cba509 | 37884:72284d296b02 |
---|---|
108 ui.status(_('collecting CVS rlog\n')) | 108 ui.status(_('collecting CVS rlog\n')) |
109 | 109 |
110 log = [] # list of logentry objects containing the CVS state | 110 log = [] # list of logentry objects containing the CVS state |
111 | 111 |
112 # patterns to match in CVS (r)log output, by state of use | 112 # patterns to match in CVS (r)log output, by state of use |
113 re_00 = re.compile('RCS file: (.+)$') | 113 re_00 = re.compile(b'RCS file: (.+)$') |
114 re_01 = re.compile('cvs \\[r?log aborted\\]: (.+)$') | 114 re_01 = re.compile(b'cvs \\[r?log aborted\\]: (.+)$') |
115 re_02 = re.compile('cvs (r?log|server): (.+)\n$') | 115 re_02 = re.compile(b'cvs (r?log|server): (.+)\n$') |
116 re_03 = re.compile("(Cannot access.+CVSROOT)|" | 116 re_03 = re.compile(b"(Cannot access.+CVSROOT)|" |
117 "(can't create temporary directory.+)$") | 117 b"(can't create temporary directory.+)$") |
118 re_10 = re.compile('Working file: (.+)$') | 118 re_10 = re.compile(b'Working file: (.+)$') |
119 re_20 = re.compile('symbolic names:') | 119 re_20 = re.compile(b'symbolic names:') |
120 re_30 = re.compile('\t(.+): ([\\d.]+)$') | 120 re_30 = re.compile(b'\t(.+): ([\\d.]+)$') |
121 re_31 = re.compile('----------------------------$') | 121 re_31 = re.compile(b'----------------------------$') |
122 re_32 = re.compile('=======================================' | 122 re_32 = re.compile(b'=======================================' |
123 '======================================$') | 123 b'======================================$') |
124 re_50 = re.compile('revision ([\\d.]+)(\s+locked by:\s+.+;)?$') | 124 re_50 = re.compile(b'revision ([\\d.]+)(\s+locked by:\s+.+;)?$') |
125 re_60 = re.compile(r'date:\s+(.+);\s+author:\s+(.+);\s+state:\s+(.+?);' | 125 re_60 = re.compile(br'date:\s+(.+);\s+author:\s+(.+);\s+state:\s+(.+?);' |
126 r'(\s+lines:\s+(\+\d+)?\s+(-\d+)?;)?' | 126 br'(\s+lines:\s+(\+\d+)?\s+(-\d+)?;)?' |
127 r'(\s+commitid:\s+([^;]+);)?' | 127 br'(\s+commitid:\s+([^;]+);)?' |
128 r'(.*mergepoint:\s+([^;]+);)?') | 128 br'(.*mergepoint:\s+([^;]+);)?') |
129 re_70 = re.compile('branches: (.+);$') | 129 re_70 = re.compile(b'branches: (.+);$') |
130 | 130 |
131 file_added_re = re.compile(r'file [^/]+ was (initially )?added on branch') | 131 file_added_re = re.compile(br'file [^/]+ was (initially )?added on branch') |
132 | 132 |
133 prefix = '' # leading path to strip of what we get from CVS | 133 prefix = '' # leading path to strip of what we get from CVS |
134 | 134 |
135 if directory is None: | 135 if directory is None: |
136 # Current working directory | 136 # Current working directory |
727 # Find parent changesets, handle {{mergetobranch BRANCHNAME}} | 727 # Find parent changesets, handle {{mergetobranch BRANCHNAME}} |
728 # by inserting dummy changesets with two parents, and handle | 728 # by inserting dummy changesets with two parents, and handle |
729 # {{mergefrombranch BRANCHNAME}} by setting two parents. | 729 # {{mergefrombranch BRANCHNAME}} by setting two parents. |
730 | 730 |
731 if mergeto is None: | 731 if mergeto is None: |
732 mergeto = r'{{mergetobranch ([-\w]+)}}' | 732 mergeto = br'{{mergetobranch ([-\w]+)}}' |
733 if mergeto: | 733 if mergeto: |
734 mergeto = re.compile(mergeto) | 734 mergeto = re.compile(mergeto) |
735 | 735 |
736 if mergefrom is None: | 736 if mergefrom is None: |
737 mergefrom = r'{{mergefrombranch ([-\w]+)}}' | 737 mergefrom = br'{{mergefrombranch ([-\w]+)}}' |
738 if mergefrom: | 738 if mergefrom: |
739 mergefrom = re.compile(mergefrom) | 739 mergefrom = re.compile(mergefrom) |
740 | 740 |
741 versions = {} # changeset index where we saw any particular file version | 741 versions = {} # changeset index where we saw any particular file version |
742 branches = {} # changeset index where we saw a branch | 742 branches = {} # changeset index where we saw a branch |