The New server is Linux version 2.6.9-78.ELsmp (Red Hat 3.4.6-10) ; and patch version is patch 2.5.4 and The old machine is Linux version 2.4.20-8 (Red Hat Linux 3.2.2-5) and patch version is also patch 2.5.4.
In the tmp dir reviewboard.6D8dUl/ there are four files. --------------------------------------------------------------------------- myfile.py.diff 1 Index: tools/review_board_install/cvs2rb/cvs_hook_script.py 2 =================================================================== 3 RCS file: /export/home/cvsroot/tools/review_board_install/ cvs2rb/cvs_hook_script.py,v 4 retrieving revision 1.2 5 retrieving revision 1.3 6 diff -u -r1.2 -r1.3 7 --- tools/review_board_install/cvs2rb/cvs_hook_script.py 2010/03/17 02:29:21 1.2 8 +++ tools/review_board_install/cvs2rb/cvs_hook_script.py 2010/03/18 08:08:40 1.3 9 @@ -1,156 +1,34 @@ 10 #! /usr/local/bin/python 11 import sys 12 import os 13 -import commands 14 -import string 15 import time 16 -import logging 17 - 18 - 19 -#------------------------------------------------- GET PATH INFO 20 -from cvs_hook_script_config import get_path_info 21 -from cvs_hook_script_config import get_sys_info 22 -from cvs_hook_script_config import get_log_html 23 -from random import randint 24 -from os.path import exists 25 -from logging import handlers 26 - 27 - 28 -FILE_GENERATOR_LOW = get_sys_info("FILE_GENERATOR_LOW") 29 -FILE_GENERATOR_HIGH = get_sys_info("FILE_GENERATOR_HIGH") 30 -LOG_FILE_PATH = get_path_info("LOG_FILE_PATH") 31 -ERROR_INFO_PATH = get_path_info("ERROR_INFO_PATH") 32 -LOG_HTML_PATH = get_path_info("LOG_HTML_PATH") 33 -DATE_FORMAT = "%Y-%m-%d %A %H:%M:%S" 34 - 35 - 36 - 37 -#-------------------------------------------------- USEFUL FUNCTIONS 38 -def is_usable(parameter_info): 39 - """ 40 - Judging whether this commit log is New directory or imported source. 41 - """ 42 - if (parameter_info.find("- New directory")!=-1) or (parameter_info.find("- Imported Sources")!=-1): 43 - information = "CVS_CM_LOG.PY In CVS2RB. Notice: There is a commit of NewDectionary Or ImportedSource. \ 44 - Parameter is: %s\n" % parameter_info 45 - Logger.info(information) 46 - return False 47 - else: 48 - return True 49 - 50 -def get_file_name(): 51 - """ 52 - Generating log file name. 53 - """ 54 - low = int(FILE_GENERATOR_LOW) 55 - high = int(FILE_GENERATOR_HIGH) 56 - file_name_part = str(randint(low, high)) 57 - file_name = file_name_part + ".cminfo" 58 - while( exists(LOG_FILE_PATH + file_name) ): 59 - file_name_part = str(randint(low, high)) 60 - file_name = file_name_part + ".cminfo" 61 - return file_name 62 - 63 -def get_committer_name(parameter_info): 64 - """ 65 - Fetch the committer's name. 66 - """ 67 - file_list = parameter_info.split(" ")[1:] 68 - if not file_list: 69 - error_info = "CVS_CM_LOG.PY In CVS2RB. Kernel Error: There is no file info in this commit parameter: \ 70 - ' %s '\n" % parameter_info 71 - Logger.critical(error_info) 72 - print error_info 73 - sys.exit() 74 - file_info_list = file_list[0].strip().split(",") 75 - if len(file_info_list) !=4: 76 - error_info = "CVS_CM_LOG.PY In CVS2RB. Kernel Error: Some file info in this commit parameter: \ 77 - ' %s ' is Not Complete or Too Much! \n" % parameter_info 78 - Logger.critical.write(error_info) 79 - print error_info 80 - sys.exit() 81 - return file_info_list[-1].strip() 82 +import commands 83 84 +from cvs_hook_rb import generate_rb_log 85 +from cvs_hook_weblog import generate_weblog_xml 86 87 +DATE_FORMAT = "%Y-%m-%d %A %H:%M:%S" 88 89 #-------------------------------------------------SCRIPT BODY 90 -Logger = logging.getLogger('CVS_HOOK_SCRIPT_LOGGER') 91 -Root_Format = logging.Formatter("%(message)s") 92 -Sub_Format = logging.Formatter("%(asctime)s % (levelname)-8s>>>>> %(message)s") 93 -exec_error_path= ERROR_INFO_PATH + "cvs_cm_log_error.log" 94 -log_hdr = handlers.TimedRotatingFileHandler(exec_error_path,'D',30,1) 95 -log_hdr.setFormatter(Root_Format) 96 -Logger.addHandler(log_hdr) 97 -Logger.setLevel(logging.DEBUG) 98 -#exec_error_file = open(exec_error_path, "a") 99 -exec_error_file_begin = "\nNEW_EXECUTION=================================================================BEGIN \n" 100 -Logger.info(exec_error_file_begin) 101 -Logger.info(sys.argv[1]+ "\n") 102 -log_hdr.setFormatter(Sub_Format) 103 -if len(sys.argv) == 2: 104 +def main(): 105 + if len(sys.argv) == 2: 106 parameter_info = sys.argv[1].strip() 107 -else: 108 - error_info = "CVS_CM_LOG.PY In CVS2RB. Kernel Error: The parameters info is not complete or too much!\n" 109 - Logger.error(error_info) 110 - print error_info 111 - sys.exit() 112 -if not is_usable(parameter_info): 113 - Logger.error("Execution Fine! only added dirs or imported codes! \n") 114 + else: 115 + print "CVS_HOOK_SCRIPT.PY In CVS2RB. Kernel Error: The parameters info is not complete or too much!\n" 116 sys.exit() 117 -date_info = time.strftime(DATE_FORMAT) 118 - 119 - 120 -log_info = commands.getoutput("(cat)") 121 -try: # Convert To UTF8 122 + date_info = time.strftime(DATE_FORMAT) 123 + log_info = commands.getoutput("(cat)") 124 + try: # Convert To UTF8 125 log_info.decode("utf-8") 126 -except: 127 + except: 128 try: 129 - log_info = log_info.decode("GB18030").encode("utf-8") 130 + log_info = log_info.decode("GB18030").encode("utf-8") 131 except: 132 - try: 133 - log_info = log_info.decode("iso-8859-1").encode("utf-8") 134 - except: 135 - pass 136 - 137 -user_name = get_committer_name(parameter_info) 138 -if(log_info.find("Added Files") == -1) and (log_info.find("Modified Files") == -1): 139 - Logger.info("Execution Fine! only remove file info! \n") 140 - sys.exit() 141 -#exec_error_file.write("Commitor ID: " + user_id +"\n") 142 -file_name = LOG_FILE_PATH + get_file_name().strip() 143 -Logger.info("Generating Log File " + file_name) 144 - 145 -from os.path import isfile 146 -if isfile(file_name): # Log File Name Conflict! 147 - Logger.error("Error: The file name "+file_name+ " has been used before! Exit Now! \n") 148 - sys.exit() 149 -dest_file = open(file_name, "w") 150 -dest_file.write(parameter_info + "\n") # {sVvU} info string 151 -dest_file.write(date_info+"\n") # cvs hook spark time 152 -dest_file.write(log_info) # cvs commit log info string 153 -dest_file.close() 154 -change_mode = os.system("chmod 666 '" + file_name + "'") 155 -if change_mode: 156 - Logger.error("Error: I can't use 'chmod' command to file " + file_name + "\n") 157 -html_file_name = get_log_html(parameter_info.strip().split(" ")[0]) # Getting html file name with path match 158 -if not html_file_name: 159 - Logger.warning( 160 - "warning: the paramter ' %s ' project path has no matched html log file!\n" % parameter_info) 161 - sys.exit() 162 -html_file = open (LOG_HTML_PATH + html_file_name, "a") 163 -html_file.write("<NewCommit>\n<Committer>\n") 164 -html_file.write( user_name + "\n") 165 -html_file.write("</Committer>\n<CommitDate format='" + DATE_FORMAT + "'>\n") 166 -html_file.write( date_info + "\n") 167 -html_file.write("</CommitDate>\n<LogMessage>\n") 168 -log_message_index = log_info.find("Log Message:") 169 -if log_message_index != -1: 170 - log_message_info = log_info[log_message_index:] 171 -else: 172 - log_message_info = "No Log Message." 173 -html_file.write(log_message_info) 174 -html_file.write("</LogMessage>\n</NewCommit>\n") 175 -html_file.close() 176 -os.system("chmod 666 '" + LOG_HTML_PATH + html_file_name + "'") 177 -Logger.info("Execution Fine! \n") 178 -os.system("chmod 666 '" + exec_error_path + "'") 179 + try: 180 + log_info = log_info.decode("iso-8859-1").encode("utf-8") 181 + except: 182 + pass 183 + generate_rb_log(parameter_info, date_info, DATE_FORMAT, log_info) 184 + generate_weblog_xml(parameter_info, date_info, DATE_FORMAT, log_info) 185 +if __name__ =='__main__': 186 + main() --------------------------------------------------------------------------- tmpoMITg5-new.rej 1 *************** 2 *** 1,156 **** 3 #! /usr/local/bin/python 4 import sys 5 import os 6 - import commands 7 - import string 8 import time 9 - import logging 10 - 11 - 12 - #------------------------------------------------- GET PATH INFO 13 - from cvs_hook_script_config import get_path_info 14 - from cvs_hook_script_config import get_sys_info 15 - from cvs_hook_script_config import get_log_html 16 - from random import randint 17 - from os.path import exists 18 - from logging import handlers 19 - 20 - 21 - FILE_GENERATOR_LOW = get_sys_info("FILE_GENERATOR_LOW") 22 - FILE_GENERATOR_HIGH = get_sys_info("FILE_GENERATOR_HIGH") 23 - LOG_FILE_PATH = get_path_info("LOG_FILE_PATH") 24 - ERROR_INFO_PATH = get_path_info("ERROR_INFO_PATH") 25 - LOG_HTML_PATH = get_path_info("LOG_HTML_PATH") 26 - DATE_FORMAT = "%Y-%m-%d %A %H:%M:%S" 27 - 28 - 29 - 30 - #-------------------------------------------------- USEFUL FUNCTIONS 31 - def is_usable(parameter_info): 32 - """ 33 - Judging whether this commit log is New directory or imported source. 34 - """ 35 - if (parameter_info.find("- New directory")!=-1) or (parameter_info.find("- Imported Sources")!=-1): 36 - information = "CVS_CM_LOG.PY In CVS2RB. Notice: There is a commit of NewDectionary Or ImportedSource. \ 37 - Parameter is: %s\n" % parameter_info 38 - Logger.info(information) 39 - return False 40 - else: 41 - return True 42 - 43 - def get_file_name(): 44 - """ 45 - Generating log file name. 46 - """ 47 - low = int(FILE_GENERATOR_LOW) 48 - high = int(FILE_GENERATOR_HIGH) 49 - file_name_part = str(randint(low, high)) 50 - file_name = file_name_part + ".cminfo" 51 - while( exists(LOG_FILE_PATH + file_name) ): 52 - file_name_part = str(randint(low, high)) 53 - file_name = file_name_part + ".cminfo" 54 - return file_name 55 - 56 - def get_committer_name(parameter_info): 57 - """ 58 - Fetch the committer's name. 59 - """ 60 - file_list = parameter_info.split(" ")[1:] 61 - if not file_list: 62 - error_info = "CVS_CM_LOG.PY In CVS2RB. Kernel Error: There is no file info in this commit parameter: \ 63 - ' %s '\n" % parameter_info 64 - Logger.critical(error_info) 65 - print error_info 66 - sys.exit() 67 - file_info_list = file_list[0].strip().split(",") 68 - if len(file_info_list) !=4: 69 - error_info = "CVS_CM_LOG.PY In CVS2RB. Kernel Error: Some file info in this commit parameter: \ 70 - ' %s ' is Not Complete or Too Much! \n" % parameter_info 71 - Logger.critical.write(error_info) 72 - print error_info 73 - sys.exit() 74 - return file_info_list[-1].strip() 75 76 77 78 #-------------------------------------------------SCRIPT BODY 79 - Logger = logging.getLogger('CVS_HOOK_SCRIPT_LOGGER') 80 - Root_Format = logging.Formatter("%(message)s") 81 - Sub_Format = logging.Formatter("%(asctime)s % (levelname)-8s>>>>> %(message)s") 82 - exec_error_path= ERROR_INFO_PATH + "cvs_cm_log_error.log" 83 - log_hdr = handlers.TimedRotatingFileHandler(exec_error_path,'D',30,1) 84 - log_hdr.setFormatter(Root_Format) 85 - Logger.addHandler(log_hdr) 86 - Logger.setLevel(logging.DEBUG) 87 - #exec_error_file = open(exec_error_path, "a") 88 - exec_error_file_begin = "\nNEW_EXECUTION=================================================================BEGIN \n" 89 - Logger.info(exec_error_file_begin) 90 - Logger.info(sys.argv[1]+ "\n") 91 - log_hdr.setFormatter(Sub_Format) 92 - if len(sys.argv) == 2: 93 parameter_info = sys.argv[1].strip() 94 - else: 95 - error_info = "CVS_CM_LOG.PY In CVS2RB. Kernel Error: The parameters info is not complete or too much!\n" 96 - Logger.error(error_info) 97 - print error_info 98 - sys.exit() 99 - if not is_usable(parameter_info): 100 - Logger.error("Execution Fine! only added dirs or imported codes! \n") 101 sys.exit() 102 - date_info = time.strftime(DATE_FORMAT) 103 - 104 - 105 - log_info = commands.getoutput("(cat)") 106 - try: # Convert To UTF8 107 log_info.decode("utf-8") 108 - except: 109 try: 110 - log_info = log_info.decode("GB18030").encode("utf-8") 111 except: 112 - try: 113 - log_info = log_info.decode("iso-8859-1").encode("utf-8") 114 - except: 115 - pass 116 - 117 - user_name = get_committer_name(parameter_info) 118 - if(log_info.find("Added Files") == -1) and (log_info.find("Modified Files") == -1): 119 - Logger.info("Execution Fine! only remove file info! \n") 120 - sys.exit() 121 - #exec_error_file.write("Commitor ID: " + user_id +"\n") 122 - file_name = LOG_FILE_PATH + get_file_name().strip() 123 - Logger.info("Generating Log File " + file_name) 124 - 125 - from os.path import isfile 126 - if isfile(file_name): # Log File Name Conflict! 127 - Logger.error("Error: The file name "+file_name+ " has been used before! Exit Now! \n") 128 - sys.exit() 129 - dest_file = open(file_name, "w") 130 - dest_file.write(parameter_info + "\n") # {sVvU} info string 131 - dest_file.write(date_info+"\n") # cvs hook spark time 132 - dest_file.write(log_info) # cvs commit log info string 133 - dest_file.close() 134 - change_mode = os.system("chmod 666 '" + file_name + "'") 135 - if change_mode: 136 - Logger.error("Error: I can't use 'chmod' command to file " + file_name + "\n") 137 - html_file_name = get_log_html(parameter_info.strip().split(" ")[0]) # Getting html file name with path match 138 - if not html_file_name: 139 - Logger.warning( 140 - "warning: the paramter ' %s ' project path has no matched html log file!\n" % parameter_info) 141 - sys.exit() 142 - html_file = open (LOG_HTML_PATH + html_file_name, "a") 143 - html_file.write("<NewCommit>\n<Committer>\n") 144 - html_file.write( user_name + "\n") 145 - html_file.write("</Committer>\n<CommitDate format='" + DATE_FORMAT + "'>\n") 146 - html_file.write( date_info + "\n") 147 - html_file.write("</CommitDate>\n<LogMessage>\n") 148 - log_message_index = log_info.find("Log Message:") 149 - if log_message_index != -1: 150 - log_message_info = log_info[log_message_index:] 151 - else: 152 - log_message_info = "No Log Message." 153 - html_file.write(log_message_info) 154 - html_file.write("</LogMessage>\n</NewCommit>\n") 155 - html_file.close() 156 - os.system("chmod 666 '" + LOG_HTML_PATH + html_file_name + "'") 157 - Logger.info("Execution Fine! \n") 158 - os.system("chmod 666 '" + exec_error_path + "'") 159 --- 1,34 ---- 160 #! /usr/local/bin/python 161 import sys 162 import os 163 import time 164 + import commands 165 166 + from cvs_hook_rb import generate_rb_log 167 + from cvs_hook_weblog import generate_weblog_xml 168 169 + DATE_FORMAT = "%Y-%m-%d %A %H:%M:%S" 170 171 #-------------------------------------------------SCRIPT BODY 172 + def main(): 173 + if len(sys.argv) == 2: 174 parameter_info = sys.argv[1].strip() 175 + else: 176 + print "CVS_HOOK_SCRIPT.PY In CVS2RB. Kernel Error: The parameters info is not complete or too much!\n" 177 sys.exit() 178 + date_info = time.strftime(DATE_FORMAT) 179 + log_info = commands.getoutput("(cat)") 180 + try: # Convert To UTF8 181 log_info.decode("utf-8") 182 + except: 183 try: 184 + log_info = log_info.decode("GB18030").encode("utf-8") 185 except: 186 + try: 187 + log_info = log_info.decode("iso-8859-1").encode("utf-8") 188 + except: 189 + pass 190 + generate_rb_log(parameter_info, date_info, DATE_FORMAT, log_info) 191 + generate_weblog_xml(parameter_info, date_info, DATE_FORMAT, log_info) 192 + if __name__ =='__main__': 193 + main() ---------------------------------------------------------------------------- And there are also two files tmpoMITg5 and tmpoMITg5-new, Both files are empty. Best Regards! On 4月1日, 上午2时58分, Christian Hammond <chip...@chipx86.com> wrote: > I'd have to see the files in that temp directory to really be able to > diagnose why this is happening. > > What OS/distro is on the new server? What version of patch? > > Christian > > -- > Christian Hammond - chip...@chipx86.com > Review Board -http://www.reviewboard.org > VMware, Inc. -http://www.vmware.com > > On Wed, Mar 31, 2010 at 8:16 AM, JohnHenry <qhlonl...@163.com> wrote: > > Hi, all. > > I am doing migration of reviewboard from one machine to another. > > We had installed a new reviewboard the other machine ,and then > > backup mysql database into this machine mysql. > > From source machine, do: > > ./mysqldump -uroot -h 127.0.0.1 -P 3309 --default-character-set=utf8 - > > B reviewboard >mysql_reviewboard.sq > > And then at the destinate machine: > > mysql -uroot -h 127.0.0.1 reviewboard < /home/review_board/bin/ > > mysql/bin/mysql_reviewboard.sql > > After some configuration, The reviewboard on the other machine can > > be access then( We had change the destinate machine IP the same with > > source machine IP) > > But when We want to open the "view diff " page, It always report > > the like: > > -------------------------------------------------------------- > > Traceback (most recent call last): > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > ReviewBoard-1.0.5.1-py2.5.egg/reviewboard/diffviewer/views.py", line > > 153, in view_diff > > interdiffset, highlighting, True) > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > ReviewBoard-1.0.5.1-py2.5.egg/reviewboard/diffviewer/diffutils.py", > > line 623, in get_diff_files > > large_data=True) > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > Djblets-0.5.9-py2.5.egg/djblets/util/misc.py", line 166, in > > cache_memoize > > data = lookup_callable() > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > ReviewBoard-1.0.5.1-py2.5.egg/reviewboard/diffviewer/diffutils.py", > > line 622, in <lambda> > > enable_syntax_highlighting), > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > ReviewBoard-1.0.5.1-py2.5.egg/reviewboard/diffviewer/diffutils.py", > > line 345, in get_chunks > > new = get_patched_file(old, filediff) > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > ReviewBoard-1.0.5.1-py2.5.egg/reviewboard/diffviewer/diffutils.py", > > line 261, in get_patched_file > > return patch(filediff.diff, buffer, filediff.dest_file) > > File "/home/review_board/bin/python/lib/python2.5/site-packages/ > > ReviewBoard-1.0.5.1-py2.5.egg/reviewboard/diffviewer/diffutils.py", > > line 129, in patch > > (filename, tempdir, patch_output)) > > Exception: The patch to 'test.c' didn't apply cleanly. The temporary > > files have been left in '/tmp/reviewboard.455uwf' for debugging > > purposes. > > `patch` returned: patching file /tmp/reviewboard.455uwf/tmpeddSyU > > Hunk #1 FAILED at 1. > > 1 out of 1 hunk FAILED -- saving rejects to file /tmp/reviewboard. > > 455uwf/tmpeddSyU-new.rej > > ----------------------------------------------------------------- > > > New added file has no such problem, It occures only on "patch" needed > > "diff views" page; I don't know why, What is the reason for this? And > > how to avoid this? > > > Best Regards! > > > -- > > Want to help the Review Board project? Donate today at > >http://www.reviewboard.org/donate/ > > Happy user? Let us know athttp://www.reviewboard.org/users/ > > -~----------~----~----~----~------~----~------~--~--- > > To unsubscribe from this group, send email to > > reviewboard+unsubscr...@googlegroups.com<reviewboard%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/reviewboard?hl=en > > > To unsubscribe, reply using "remove me" as the subject. -- Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/ Happy user? Let us know at http://www.reviewboard.org/users/ -~----------~----~----~----~------~----~------~--~--- To unsubscribe from this group, send email to reviewboard+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en