This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import site | |
import os | |
import pathlib | |
# Big thanks to Match on StackOverflow for helping me with this | |
# see https://stackoverflow.com/a/48713998/5614280 | |
# This is some cool hackery to overwrite the default functionality of | |
# the builtin print function within you're entire python environment | |
# to display the file name and the line number as well as always flush | |
# the output. It works by creating a custom user script and placing it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# I was frustrated that no matter what buffer setting I passed to communicate, | |
# I could not get stdout from my subprocess until the process had completed. | |
# I googled around and came up with this, which illustrates the problem and a | |
# solution. | |
# http://stackoverflow.com/questions/2804543/read-subprocess-stdout-line-by-line | |
# http://bugs.python.org/issue3907 | |
# http://docs.python.org/library/io.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Give yourself a split view of your changes when you're committing | |
# | |
# If you patch hgext/record.py you can even show the changes you're | |
# cherry picking. | |
# | |
# Usage: | |
# HGEDITOR=~/bin/hg_ci_editor.sh hg ci ... | |
# HGEDITOR=~/bin/hg_ci_editor.sh hg record ... |