Package: mr
Severity: wishlist
Tags: patch
Usertags: sentpatch

I sometimes want to run git clean -dxf to get rid of ignored and
untracked files. So, I added that to my personal config, but I think
this would be useful for other folks so I've attached a patch adding
this capability for other VCSen.

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
From e508e60a1d4b11ba66c7830a221acd07cf62634b Mon Sep 17 00:00:00 2001
From: Paul Wise <p...@debian.org>
Date: Sun, 10 Mar 2013 14:21:03 +0800
Subject: [PATCH] Add a clean command that works like git clean -dxf where
 possible

---
 debian/changelog |  1 +
 debian/control   |  2 +-
 mr               | 18 ++++++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index e9a3688..66a1fc9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
 mr (1.15) unstable; urgency=low
 
+  * Add a clean command that works like git clean -dxf where possible
   * When in quiet mode, do not show messages about skipping undefined commands
   * Make quiet mode show output if there is some. Closes: #694031
   * Pass a fake terminal to subcommands when mr is run in a terminal
diff --git a/debian/control b/debian/control
index 2700380..9562429 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Package: mr
 Architecture: all
 Section: vcs
 Depends: ${misc:Depends}
-Suggests: subversion, git-core | git (>= 1:1.7), cvs, bzr, mercurial, darcs, fossil, vcsh, liburi-perl, curl
+Suggests: subversion, subversion-tools, git-core | git (>= 1:1.7), cvs, kdesdk-scripts, bzr, mercurial, darcs, fossil, vcsh, liburi-perl, curl
 Recommends: libwww-perl, libio-pty-easy-perl, libhtml-parser-perl, perl
 Description: Multiple Repository management tool
  The mr(1) command can checkout, update, or perform other actions on
diff --git a/mr b/mr
index 1696c44..ec58b8b 100755
--- a/mr
+++ b/mr
@@ -12,6 +12,8 @@ B<mr> [options] update
 
 B<mr> [options] status
 
+B<mr> [options] clean
+
 B<mr> [options] commit [-m "message"]
 
 B<mr> [options] record [-m "message"]
@@ -78,6 +80,13 @@ Displays a status report for each repository, showing what
 uncommitted changes are present in the repository. For distributed version
 control systems, also shows unpushed local branches.
 
+=item clean
+
+Delete ignored files, untracked files and other cruft from the working
+directory. For most VCS, this will print the files that are being removed.
+Depending on the VCS, there may be an option to only print the filenames
+to be removed instead of removing them.
+
 =item commit (or ci)
 
 Commits changes to each repository. (By default, changes are pushed to the
@@ -1937,6 +1946,15 @@ git_svn_fetch = git svn fetch
 darcs_fetch = darcs fetch
 hg_fetch = hg pull
 
+svn_clean = svn-clean
+git_clean = git clean -dx --force "$@"
+git_svn_clean = git clean -dx --force "$@"
+bzr_clean = bzr clean-tree --verbose --force --ignored --unknown --detritus "$@"
+cvs_clean = cvs-clean
+hg_clean = hg purge --all "$@"
+fossil_clean = fossil clean --force --dotfiles --temp "$@"
+vcsh_commit = vcsh run "$MR_REPO" git clean -dx --force "$@"
+
 svn_status = svn status "$@"
 git_status = git status -s "$@" || true; git --no-pager log --branches --not --remotes --simplify-by-decoration --decorate --oneline || true
 bzr_status = bzr status --short "$@"; bzr missing
-- 
1.8.2.rc3

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to