##// END OF EJS Templates
convert/cvsps: wrap long lines
Martin Geisler -
r8661:883f14fc default
parent child Browse files
Show More
@@ -34,7 +34,8 b' class logentry(object):'
34 .revision - revision number as tuple
34 .revision - revision number as tuple
35 .tags - list of tags on the file
35 .tags - list of tags on the file
36 .synthetic - is this a synthetic "file ... added on ..." revision?
36 .synthetic - is this a synthetic "file ... added on ..." revision?
37 .mergepoint- the branch that has been merged from (if present in rlog output)
37 .mergepoint- the branch that has been merged from
38 (if present in rlog output)
38 '''
39 '''
39 def __init__(self, **entries):
40 def __init__(self, **entries):
40 self.__dict__.update(entries)
41 self.__dict__.update(entries)
@@ -105,14 +106,18 b' def createlog(ui, directory=None, root="'
105 re_00 = re.compile('RCS file: (.+)$')
106 re_00 = re.compile('RCS file: (.+)$')
106 re_01 = re.compile('cvs \\[r?log aborted\\]: (.+)$')
107 re_01 = re.compile('cvs \\[r?log aborted\\]: (.+)$')
107 re_02 = re.compile('cvs (r?log|server): (.+)\n$')
108 re_02 = re.compile('cvs (r?log|server): (.+)\n$')
108 re_03 = re.compile("(Cannot access.+CVSROOT)|(can't create temporary directory.+)$")
109 re_03 = re.compile("(Cannot access.+CVSROOT)|"
110 "(can't create temporary directory.+)$")
109 re_10 = re.compile('Working file: (.+)$')
111 re_10 = re.compile('Working file: (.+)$')
110 re_20 = re.compile('symbolic names:')
112 re_20 = re.compile('symbolic names:')
111 re_30 = re.compile('\t(.+): ([\\d.]+)$')
113 re_30 = re.compile('\t(.+): ([\\d.]+)$')
112 re_31 = re.compile('----------------------------$')
114 re_31 = re.compile('----------------------------$')
113 re_32 = re.compile('=============================================================================$')
115 re_32 = re.compile('======================================='
116 '======================================$')
114 re_50 = re.compile('revision ([\\d.]+)(\s+locked by:\s+.+;)?$')
117 re_50 = re.compile('revision ([\\d.]+)(\s+locked by:\s+.+;)?$')
115 re_60 = re.compile(r'date:\s+(.+);\s+author:\s+(.+);\s+state:\s+(.+?);(\s+lines:\s+(\+\d+)?\s+(-\d+)?;)?(.*mergepoint:\s+([^;]+);)?')
118 re_60 = re.compile(r'date:\s+(.+);\s+author:\s+(.+);\s+state:\s+(.+?);'
119 r'(\s+lines:\s+(\+\d+)?\s+(-\d+)?;)?'
120 r'(.*mergepoint:\s+([^;]+);)?')
116 re_70 = re.compile('branches: (.+);$')
121 re_70 = re.compile('branches: (.+);$')
117
122
118 file_added_re = re.compile(r'file [^/]+ was (initially )?added on branch')
123 file_added_re = re.compile(r'file [^/]+ was (initially )?added on branch')
@@ -282,7 +287,8 b' def createlog(ui, directory=None, root="'
282 if re_31.match(line):
287 if re_31.match(line):
283 state = 5
288 state = 5
284 else:
289 else:
285 assert not re_32.match(line), _('must have at least some revisions')
290 assert not re_32.match(line), _('must have at least '
291 'some revisions')
286
292
287 elif state == 5:
293 elif state == 5:
288 # expecting revision number and possibly (ignored) lock indication
294 # expecting revision number and possibly (ignored) lock indication
@@ -308,7 +314,9 b' def createlog(ui, directory=None, root="'
308 if len(d.split()) != 3:
314 if len(d.split()) != 3:
309 # cvs log dates always in GMT
315 # cvs log dates always in GMT
310 d = d + ' UTC'
316 d = d + ' UTC'
311 e.date = util.parsedate(d, ['%y/%m/%d %H:%M:%S', '%Y/%m/%d %H:%M:%S', '%Y-%m-%d %H:%M:%S'])
317 e.date = util.parsedate(d, ['%y/%m/%d %H:%M:%S',
318 '%Y/%m/%d %H:%M:%S',
319 '%Y-%m-%d %H:%M:%S'])
312 e.author = scache(match.group(2))
320 e.author = scache(match.group(2))
313 e.dead = match.group(3).lower() == 'dead'
321 e.dead = match.group(3).lower() == 'dead'
314
322
@@ -443,7 +451,8 b' class changeset(object):'
443 .parents - list of one or two parent changesets
451 .parents - list of one or two parent changesets
444 .tags - list of tags on this changeset
452 .tags - list of tags on this changeset
445 .synthetic - from synthetic revision "file ... added on branch ..."
453 .synthetic - from synthetic revision "file ... added on branch ..."
446 .mergepoint- the branch that has been merged from (if present in rlog output)
454 .mergepoint- the branch that has been merged from
455 (if present in rlog output)
447 '''
456 '''
448 def __init__(self, **entries):
457 def __init__(self, **entries):
449 self.__dict__.update(entries)
458 self.__dict__.update(entries)
@@ -689,9 +698,10 b' def createchangeset(ui, log, fuzz=60, me'
689
698
690
699
691 def debugcvsps(ui, *args, **opts):
700 def debugcvsps(ui, *args, **opts):
692 '''Read CVS rlog for current directory or named path in repository, and
701 '''Read CVS rlog for current directory or named path in
693 convert the log to changesets based on matching commit log entries and dates.'''
702 repository, and convert the log to changesets based on matching
694
703 commit log entries and dates.
704 '''
695 if opts["new_cache"]:
705 if opts["new_cache"]:
696 cache = "write"
706 cache = "write"
697 elif opts["update_cache"]:
707 elif opts["update_cache"]:
@@ -724,7 +734,8 b' def debugcvsps(ui, *args, **opts):'
724
734
725 if opts["ancestors"]:
735 if opts["ancestors"]:
726 if cs.branch not in branches and cs.parents and cs.parents[0].id:
736 if cs.branch not in branches and cs.parents and cs.parents[0].id:
727 ancestors[cs.branch] = changesets[cs.parents[0].id-1].branch, cs.parents[0].id
737 ancestors[cs.branch] = (changesets[cs.parents[0].id-1].branch,
738 cs.parents[0].id)
728 branches[cs.branch] = cs.id
739 branches[cs.branch] = cs.id
729
740
730 # limit by branches
741 # limit by branches
@@ -736,7 +747,8 b' def debugcvsps(ui, *args, **opts):'
736 # bug-for-bug compatibility with cvsps.
747 # bug-for-bug compatibility with cvsps.
737 ui.write('---------------------\n')
748 ui.write('---------------------\n')
738 ui.write('PatchSet %d \n' % cs.id)
749 ui.write('PatchSet %d \n' % cs.id)
739 ui.write('Date: %s\n' % util.datestr(cs.date, '%Y/%m/%d %H:%M:%S %1%2'))
750 ui.write('Date: %s\n' % util.datestr(cs.date,
751 '%Y/%m/%d %H:%M:%S %1%2'))
740 ui.write('Author: %s\n' % cs.author)
752 ui.write('Author: %s\n' % cs.author)
741 ui.write('Branch: %s\n' % (cs.branch or 'HEAD'))
753 ui.write('Branch: %s\n' % (cs.branch or 'HEAD'))
742 ui.write('Tag%s: %s \n' % (['', 's'][len(cs.tags)>1],
754 ui.write('Tag%s: %s \n' % (['', 's'][len(cs.tags)>1],
General Comments 0
You need to be logged in to leave comments. Login now