diff --git a/project.py b/project.py
index ce85b86..01dc867 100644
--- a/project.py
+++ b/project.py
@@ -111,7 +111,6 @@
     self.project = project
     self.branch = branch
     self.base = base
-    self.replace_changes = None
 
   @property
   def name(self):
@@ -151,7 +150,6 @@
 
   def UploadForReview(self, people, auto_topic=False):
     self.project.UploadForReview(self.name,
-                                 self.replace_changes,
                                  people,
                                  auto_topic=auto_topic)
 
@@ -557,7 +555,6 @@
     return None
 
   def UploadForReview(self, branch=None,
-                      replace_changes=None,
                       people=([],[]),
                       auto_topic=False):
     """Uploads the named branch for code review.
@@ -600,9 +597,6 @@
       cmd.append(branch.remote.SshReviewUrl(self.UserEmail))
       cmd.append(ref_spec)
 
-      if replace_changes:
-        for change_id,commit_id in replace_changes.iteritems():
-          cmd.append('%s:refs/changes/%s/new' % (commit_id, change_id))
       if GitCommand(self, cmd, bare = True).Wait() != 0:
         raise UploadError('Upload failed')
 
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 153b3eb..1964bff 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -47,7 +47,7 @@
   common = True
   helpSummary = "Upload changes for code review"
   helpUsage="""
-%prog [--re --cc] {[<project>]... | --replace <project>}
+%prog [--re --cc] [<project>]...
 """
   helpDescription = """
 The '%prog' command is used to send changes to the Gerrit Code
@@ -67,12 +67,6 @@
 new users.  Users passed as --reviewers must already be registered
 with the code review system, or the upload will fail.
 
-If the --replace option is passed the user can designate which
-existing change(s) in Gerrit match up to the commits in the branch
-being uploaded.  For each matched pair of change,commit the commit
-will be added as a new patch set, completely replacing the set of
-files and description associated with the change in Gerrit.
-
 Configuration
 -------------
 
@@ -119,9 +113,6 @@
     p.add_option('-t',
                  dest='auto_topic', action='store_true',
                  help='Send local branch name to Gerrit Code Review')
-    p.add_option('--replace',
-                 dest='replace', action='store_true',
-                 help='Upload replacement patchesets from this branch')
     p.add_option('--re', '--reviewers',
                  type='string',  action='append', dest='reviewers',
                  help='Request reviews from these people.')
@@ -262,65 +253,6 @@
     except:
       return ""
 
-  def _ReplaceBranch(self, opt, project, people):
-    branch = project.CurrentBranch
-    if not branch:
-      print >>sys.stdout, "no branches ready for upload"
-      return
-    branch = project.GetUploadableBranch(branch)
-    if not branch:
-      print >>sys.stdout, "no branches ready for upload"
-      return
-
-    script = []
-    script.append('# Replacing from branch %s' % branch.name)
-
-    if len(branch.commits) == 1:
-      change = self._FindGerritChange(branch)
-      script.append('[%-6s] %s' % (change, branch.commits[0]))
-    else:
-      for commit in branch.commits:
-        script.append('[      ] %s' % commit)
-
-    script.append('')
-    script.append('# Insert change numbers in the brackets to add a new patch set.')
-    script.append('# To create a new change record, leave the brackets empty.')
-
-    script = Editor.EditString("\n".join(script)).split("\n")
-
-    change_re = re.compile(r'^\[\s*(\d{1,})\s*\]\s*([0-9a-f]{1,}) .*$')
-    to_replace = dict()
-    full_hashes = branch.unabbrev_commits
-
-    for line in script:
-      m = change_re.match(line)
-      if m:
-        c = m.group(1)
-        f = m.group(2)
-        try:
-          f = full_hashes[f]
-        except KeyError:
-          print 'fh = %s' % full_hashes
-          print >>sys.stderr, "error: commit %s not found" % f
-          sys.exit(1)
-        if c in to_replace:
-          print >>sys.stderr,\
-            "error: change %s cannot accept multiple commits" % c
-          sys.exit(1)
-        to_replace[c] = f
-
-    if not to_replace:
-      print >>sys.stderr, "error: no replacements specified"
-      print >>sys.stderr, "       use 'repo upload' without --replace"
-      sys.exit(1)
-
-    if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD:
-      if not _ConfirmManyUploads(multiple_branches=True):
-        _die("upload aborted by user")
-
-    branch.replace_changes = to_replace
-    self._UploadAndReport(opt, [branch], people)
-
   def _UploadAndReport(self, opt, todo, original_people):
     have_errors = False
     for branch in todo:
@@ -383,14 +315,6 @@
       cc = _SplitEmails(opt.cc)
     people = (reviewers,cc)
 
-    if opt.replace:
-      if len(project_list) != 1:
-        print >>sys.stderr, \
-              'error: --replace requires exactly one project'
-        sys.exit(1)
-      self._ReplaceBranch(opt, project_list[0], people)
-      return
-
     for project in project_list:
       avail = project.GetUploadableBranches()
       if avail:
