Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

hglib: move getLineSeparator() from reporegistry to hglib.

Changeset 281df39c178e

Parent 4592fd600f9e

by Angel Ezquerra

Changes to 2 files · Browse files at 281df39c178e Showing diff from parent 4592fd600f9e Diff from another changeset...

 
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
 
501
502
503
 
480
481
482
 
 
 
 
 
 
 
 
 
 
 
483
484
485
486
487
488
 
489
490
491
492
@@ -480,24 +480,13 @@
    # Make sure that the selected subrepo (or one of its   # subrepos!) is not already on the .hgsub file - def getLineSeparator(line): - """Get the line separator used on a given line""" - # By default assume the default OS line separator - linesep = os.linesep - lineseptypes = ['\r\n', '\n', '\r'] - for sep in lineseptypes: - if line.endswith(sep): - linesep = sep - break - return linesep -   linesep = ''   for line in lines:   spath = line.split("=")[0].strip()   if not spath:   continue   if not linesep: - linesep = getLineSeparator(line) + linesep = hglib.getLineSeparator(line)   spath = util.pconvert(spath)   if line.startswith(srelroot):   qtlib.WarningMsgBox(
 
698
699
700
 
 
 
 
 
 
 
 
 
 
 
 
698
699
700
701
702
703
704
705
706
707
708
709
710
711
@@ -698,3 +698,14 @@
  else:   host, port = netloc[:c], netloc[c + 1:]   return host, port, user, passwd + +def getLineSeparator(line): + """Get the line separator used on a given line""" + # By default assume the default OS line separator + linesep = os.linesep + lineseptypes = ['\r\n', '\n', '\r'] + for sep in lineseptypes: + if line.endswith(sep): + linesep = sep + break + return linesep