Commit 29c1c25a by Anselm Jia

added files

parent 8ac75dc2
import os, sys, getopt, datetime, pipes, glob, itertools, tempfile, string
import re, platform, threading, time, copy
from os.path import *
from os import getcwd,environ,walk
from datetime import datetime
from glob import glob
from sys import argv, exit
from getopt import getopt
from itertools import count
# add parent dir to python module search path
sys.path.append('..')
import sys
# add parent dir to python module search path
sys.path.append('..')
import os, sys, getopt, datetime, pipes, glob, itertools,socket
import tempfile, string, re, platform, traceback
import subprocess, math, types
from os.path import *
from os import getcwd,environ,walk
from datetime import datetime
from glob import glob
from sys import argv, exit
from getopt import getopt
from itertools import count
from time import time
# add parent dir to python module search path
sys.path.append('..')
from django.conf.urls import patterns, url
urlpatterns = patterns('',
# filebrowser urls
url(r'^browse/$', 'filebrowser.views.browse', name="fb_browse"),
url(r'^mkdir/', 'filebrowser.views.mkdir', name="fb_mkdir"),
url(r'^upload/', 'filebrowser.views.upload', name="fb_upload"),
url(r'^rename/$', 'filebrowser.views.rename', name="fb_rename"),
url(r'^delete/$', 'filebrowser.views.delete', name="fb_delete"),
url(r'^versions/$', 'filebrowser.views.versions', name="fb_versions"),
url(r'^check_file/$', 'filebrowser.views._check_file', name="fb_check"),
url(r'^upload_file/$', 'filebrowser.views._upload_file', name="fb_do_upload"),
)
# coding: utf-8
# general imports
import os, re, sys
from time import gmtime, strftime
# django imports
from django.shortcuts import render_to_response, HttpResponse
from django.template import RequestContext as Context
from django.http import HttpResponseRedirect, Http404
from django.contrib.admin.views.decorators import staff_member_required
from django.views.decorators.cache import never_cache
from django.utils.translation import ugettext as _
from django.conf import settings
from django import forms
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.dispatch import Signal
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.utils.encoding import smart_str
try:
# django SVN
from django.views.decorators.csrf import csrf_exempt
except:
# django 1.1
from django.contrib.csrf.middleware import csrf_exempt
import sys,socket,os,time
port=None
host=None
if os.environ.has_key("SHELLPORT"):
try:
port=int(os.environ.get("SHELLPORT"))
except:
print("error: parsing SHELLPORT")
if os.environ.has_key("SHELLSERVER"):
host=os.environ.get("SHELLSERVER")
if (host==None or port==None):
print("error: SHELLPORT and SHELLSERVER must be set")
sys.exit(1)
args=""
for item in sys.argv[1:]:
args+=item+" "
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))
s.send("%s" % args)
result=''
timeout=300
starttime=time.time()
exitcode=0
while True:
result+=s.recv(1024)
if result.find("setup finished")>-1 or result.find("ok:")>-1:
break
if result.find("setup failed")>-1 or result.find("error:")>-1:
exitcode=1
break
if time.time()-starttime>timeout:
print("ERROR: timed out after %d sec" % timeout)
exitcode=1
break
print(result)
s.close()
sys.exit(exitcode)
#!/usr/bin/env python
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# Gist of the script flow:
# 1. read in what the last mirror point was from an external file
# 2. get a list of changes from p4 since that last change
# 3. in tamarin do a pull update (in the event there was a change outside of p4)
# 4. loop over the changes:
# a. sync to the change
# b. capture the p4 commit message, user, date and CL#
# c. rm everything in tamarin minus .hg/
# d. copy everything from p4 clientspace into tamarin MINUS tamarin-merge.txt
# e. hg commit using p4 message (append CL# to message), p4 user and p4 date if possible
# f. hg push this change (this will make sure that if there is another change available
# that for some reason bombs out, we have at least pushed to mozilla what we could)
# g. rewrite the external tracking file with this CL#
# h. if the push fails....
# Information on how to setup the host of this script can
# be found @ https://zerowing.corp.adobe.com/x/QwU5JQ
import os, sys, getopt, datetime, pipes, glob, itertools, tempfile, string
import re, platform, threading, time, copy
from os.path import *
from os import getcwd,environ,walk
from datetime import datetime
from glob import glob
from sys import argv, exit
from getopt import getopt
from itertools import count
# add parent dir to python module search path
sys.path.append('..')
import sys
# add parent dir to python module search path
sys.path.append('..')
import os, sys, getopt, datetime, pipes, glob, itertools,socket
import tempfile, string, re, platform, traceback
import subprocess, math, types
from os.path import *
from os import getcwd,environ,walk
from datetime import datetime
from glob import glob
from sys import argv, exit
from getopt import getopt
from itertools import count
from time import time
# add parent dir to python module search path
sys.path.append('..')
import sys,socket,os,time
port=None
host=None
if os.environ.has_key("SHELLPORT"):
try:
port=int(os.environ.get("SHELLPORT"))
except:
print("error: parsing SHELLPORT")
if os.environ.has_key("SHELLSERVER"):
host=os.environ.get("SHELLSERVER")
if (host==None or port==None):
print("error: SHELLPORT and SHELLSERVER must be set")
sys.exit(1)
args=""
for item in sys.argv[1:]:
args+=item+" "
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))
s.send("%s" % args)
result=''
timeout=300
starttime=time.time()
exitcode=0
while True:
result+=s.recv(1024)
if result.find("setup finished")>-1 or result.find("ok:")>-1:
break
if result.find("setup failed")>-1 or result.find("error:")>-1:
exitcode=1
break
if time.time()-starttime>timeout:
print("ERROR: timed out after %d sec" % timeout)
exitcode=1
break
print(result)
s.close()
sys.exit(exitcode)
#!/usr/bin/env python
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# Gist of the script flow:
# 1. read in what the last mirror point was from an external file
# 2. get a list of changes from p4 since that last change
# 3. in tamarin do a pull update (in the event there was a change outside of p4)
# 4. loop over the changes:
# a. sync to the change
# b. capture the p4 commit message, user, date and CL#
# c. rm everything in tamarin minus .hg/
# d. copy everything from p4 clientspace into tamarin MINUS tamarin-merge.txt
# e. hg commit using p4 message (append CL# to message), p4 user and p4 date if possible
# f. hg push this change (this will make sure that if there is another change available
# that for some reason bombs out, we have at least pushed to mozilla what we could)
# g. rewrite the external tracking file with this CL#
# h. if the push fails....
# Information on how to setup the host of this script can
# be found @ https://zerowing.corp.adobe.com/x/QwU5JQ
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment