BugTracker.Net设置问题

# Copyright 2009 Corey Trager
# Distributed under the terms of the GNU General Public License
import sys
import subprocess
import re
import urllib
import os
#######################################################################
#
# See svn documentation for how to install a hook script.
#
#######################################################################
#######################################################################
#
# !!! Start of stuff you need to change
#
########################################################################
# BugTracker.NET username and password. The username needs to match
# a setting in Web.config.
btnet_username = "wxy"
btnet_password = "wxy"
# The path to the svn executable
# 下面这一行,不能依照官方模板的格式来,,这一行花了我整整一个晚上
svn_path = "C:\\Program Files\\CollabNet\\Subversion Server\\svn.exe"
# The URL needs to be reachable from the machine where this script is
# running. (I have a virtual directory named "btnet"). Don't
# use IIS windows security on svn_hook.aspx.
btnet_url = "http://10.129.250.99/BugTracker/svn_hook.aspx"
# The repository URL. BugTracker.NET web pages will use this URL to
# interact with this repository. If you need a username and password
# to access this repo, you configure that in Web.config. See
# Web.config for more info.
this_repository_url = "http://10.129.250.99:81/svn/TeacherManager"
bDebug = True
#######################################################################
#
# !!! End of stuff you need to change
#
#######################################################################
#######################################################################
# for debugging, display info and keep a log
#######################################################################
def debug_out(s):
if (bDebug):
f = open((os.environ["TEMP"]) + '\\btnet_svn_hook_log.txt', 'a')
f.write(s)
f.write('\n')
f.close
print s
repo = sys.argv[1]
rev = sys.argv[2]
debug_out(repo)
debug_out(rev)
#######################################################################
#
# This is where this script keeps track of previously processed
# revisions. If you delete this file, this script will send log info
# for ALL revisions to BugTracker.NET. You might want to do that to
# reload the svn_revisions and svn_affected_paths tables.
#
#######################################################################
prev_revision_file = repo + "\\hooks\\btnet_prev_revision.txt"
debug_out(prev_revision_file)
#######################################################################
# Get the log info from svn
# If we've already fetched info in the past, just fetch the info
# since the last revision
#######################################################################
# get the previous revision
try:
most_recent_revision_file = open(prev_revision_file,"r")
prev_revision = most_recent_revision_file.read(40)
most_recent_revision_file.close()
except:
prev_revision = ""
debug_out("prev_revision")
debug_out(prev_revision)
# just since previously processed revision
file_url = " file:///" + repo.replace("\\","/")
subcommand = " log --verbose --xml "
if prev_revision != "":
cmd = svn_path + subcommand + " -r " + prev_revision + ":" + rev + file_url
else:
cmd = svn_path + subcommand + file_url
debug_out(cmd)
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
debug_out("log stdout:")
log_string = process.stdout.read()
debug_out(log_string)
debug_out("stderr:")
debug_out(process.stderr.read())
# remember that we already processed this revision
most_recent_revision_file = open(prev_revision_file,"w")
most_recent_revision_file.write(rev)
most_recent_revision_file.close()
# get the first revision in the log string and save it to the file.
#######################################################################
# send an http request to BugTracker.NET, the svn_hook.aspx page.
#######################################################################
params = urllib.urlencode({
'svn_log': log_string,
'repo': this_repository_url,
'username': btnet_username,
'password': btnet_password})
response = urllib.urlopen(btnet_url, params)
data = response.read()
debug_out(data)
# Distributed under the terms of the GNU General Public License
import sys
import subprocess
import re
import urllib
import os
#######################################################################
#
# See svn documentation for how to install a hook script.
#
#######################################################################
#######################################################################
#
# !!! Start of stuff you need to change
#
########################################################################
# BugTracker.NET username and password. The username needs to match
# a setting in Web.config.
btnet_username = "wxy"
btnet_password = "wxy"
# The path to the svn executable
# 下面这一行,不能依照官方模板的格式来,,这一行花了我整整一个晚上
svn_path = "C:\\Program Files\\CollabNet\\Subversion Server\\svn.exe"
# The URL needs to be reachable from the machine where this script is
# running. (I have a virtual directory named "btnet"). Don't
# use IIS windows security on svn_hook.aspx.
btnet_url = "http://10.129.250.99/BugTracker/svn_hook.aspx"
# The repository URL. BugTracker.NET web pages will use this URL to
# interact with this repository. If you need a username and password
# to access this repo, you configure that in Web.config. See
# Web.config for more info.
this_repository_url = "http://10.129.250.99:81/svn/TeacherManager"
bDebug = True
#######################################################################
#
# !!! End of stuff you need to change
#
#######################################################################
#######################################################################
# for debugging, display info and keep a log
#######################################################################
def debug_out(s):
if (bDebug):
f = open((os.environ["TEMP"]) + '\\btnet_svn_hook_log.txt', 'a')
f.write(s)
f.write('\n')
f.close
print s
repo = sys.argv[1]
rev = sys.argv[2]
debug_out(repo)
debug_out(rev)
#######################################################################
#
# This is where this script keeps track of previously processed
# revisions. If you delete this file, this script will send log info
# for ALL revisions to BugTracker.NET. You might want to do that to
# reload the svn_revisions and svn_affected_paths tables.
#
#######################################################################
prev_revision_file = repo + "\\hooks\\btnet_prev_revision.txt"
debug_out(prev_revision_file)
#######################################################################
# Get the log info from svn
# If we've already fetched info in the past, just fetch the info
# since the last revision
#######################################################################
# get the previous revision
try:
most_recent_revision_file = open(prev_revision_file,"r")
prev_revision = most_recent_revision_file.read(40)
most_recent_revision_file.close()
except:
prev_revision = ""
debug_out("prev_revision")
debug_out(prev_revision)
# just since previously processed revision
file_url = " file:///" + repo.replace("\\","/")
subcommand = " log --verbose --xml "
if prev_revision != "":
cmd = svn_path + subcommand + " -r " + prev_revision + ":" + rev + file_url
else:
cmd = svn_path + subcommand + file_url
debug_out(cmd)
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
debug_out("log stdout:")
log_string = process.stdout.read()
debug_out(log_string)
debug_out("stderr:")
debug_out(process.stderr.read())
# remember that we already processed this revision
most_recent_revision_file = open(prev_revision_file,"w")
most_recent_revision_file.write(rev)
most_recent_revision_file.close()
# get the first revision in the log string and save it to the file.
#######################################################################
# send an http request to BugTracker.NET, the svn_hook.aspx page.
#######################################################################
params = urllib.urlencode({
'svn_log': log_string,
'repo': this_repository_url,
'username': btnet_username,
'password': btnet_password})
response = urllib.urlopen(btnet_url, params)
data = response.read()
debug_out(data)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
2008-12-02 有关firebird2.0的自动编号
2008-12-02 远程桌面文件传输