8000 changes for actual push · thouis/numpy-trac-migration@6b35244 · GitHub
[go: up one dir, main page]

Skip to content < 8000 span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">

Commit 6b35244

Browse files
committed
changes for actual push
1 parent bf727a8 commit 6b35244

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

ghissues.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ def gh_repo(r=[]):
66
if len(r) == 0:
77
u = raw_input("Github username: ")
88
p = getpass.getpass("Password: ")
9-
g = github.Github(u, p)
9+
g = github.Github(u, p, timeout=100)
1010
del p
11-
r += [g.get_user('thouis').get_repo("numpy-trac-migration")]
11+
r += [g.get_user('numpy').get_repo("numpy")]
1212
return r[0]
1313

1414
def lookup(issue):

issue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def push(self):
163163
for comment in self.github.comments:
164164
github_issue.create_comment(comment)
165165
except:
166-
print("!!! Error in ticket %s" % self.trac.id)
166+
print("!!! Error in comments for ticket %s" % self.trac.id)
167167
finally:
168168
if self.github.state == "closed":
169169
github_issue.edit(state='closed')
@@ -196,4 +196,4 @@ def t2g_markup(s):
196196
new_s.append("\n")
197197
else:
198198
new_s.append((' ' + line) if in_block else line)
199-
return '\n'.join(new_s).replace('@', 'atmention:') # avoid mentioning, REMOVE before full run
199+
return '\n'.join(new_s) # .replace('@', 'atmention:') # avoid mentioning, REMOVE before full run

move_issues.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
import time
33
import traceback
44

5+
count = 0
56
for issue in trac.issues('Numpy-snapshot-2012-10-8/numpy-trac.db'):
7+
if issue.trac.id in [2222, 2223]: #spam
8+
continue
9+
count = count + 1
610
issue.githubify()
711
try:
812
if not issue.in_github():
913
issue.push()
1014
print "PUSHED", issue.github.title
15+
time.sleep(1)
1116
else:
1217
print "EXISTS", issue.github.title
1318
except Exception, e:

util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sqlite3
2+
import re
23

34
def trac_email_to_github(email, email_map={}):
45
if len(email_map) == 0:
@@ -30,7 +31,10 @@ def mention_trac_user(user):
3031
ghuser = trac_user_to_github(user)
3132
if ghuser:
3233
all_users.append("@" + ghuser)
33-
return "atmention:" + ghuser
34+
return "@" + ghuser
3435
if user in ['', 'somebody', 'anonymous', None]:
3536
return 'unknown'
37+
# anonymize emails
38+
if '@' in user[1:]: # don't change @foo
39+
user = user.split('@')[0] + '@...'
3640
return "trac user " + user

0 commit comments

Comments
 (0)
0